acf-blocks | ACF Blocks introduces the concept of blocks
kandi X-RAY | acf-blocks Summary
kandi X-RAY | acf-blocks Summary
ACF Blocks introduces the concept of blocks, which are essentially Controllers (or actually ViewModels) for field groups and flexible layouts. Fields are created using the excellent ACF Builder library.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Returns the data for the flex form .
- Get all the blocks for a post .
- Set block data
- Render a block
- Parse the config
- Get all global field group types
- Get a block by relative position
- Get the settings for a post block .
- Find a unique index
- Set the settings data
acf-blocks Key Features
acf-blocks Examples and Code Snippets
getFieldsBuilder()
->addImage('awesome_image', ['return_format' => 'id'])
->addWysiwyg('boring_text')
->setLocation('page_template', '==', 'template-image.php');
/**
* Add a function for processing ra
'example_image';
// The location of the template
'template' => 'templates/blocks/image.php',
];
// This function is called when the block type is initialized for the first time.
// You'll use it mostly to register the
'flexible_block',
// The location of the template
'template' => 'blocks.content-builder',
];
public function init()
{
$this->getFieldsBuilder()
->setGroupConfig('title', 'Content Blocks
Community Discussions
Trending Discussions on acf-blocks
QUESTION
We're creating a block.twig template as per: https://timber.github.io/docs/guides/gutenberg/#how-to-use-acf-blocks-with-timber to use ACF Flexible Content Field Types to create Gutenberg Blocks.
For reference the following sample code would be for Repeater Field Types:
...ANSWER
Answered 2019-Mar-12 at 20:26@Rafael they're a little more complicated, just need to handle them like arrays. Let's pretend your Flexible Content field is called my_fc_field
inside of it. You created 2 layouts, each has a single text field, one called tf_one
, the other fc_two
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install acf-blocks
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page