Add inline editing for blocks (ACF 6.7+)
With the release of ACF (Pro) 6.7, inline editing is now supported. To enable this feature for blocks, you need to add “autoInlineEditing“: true to the block.json file.
This PR introduces a new configuration option to enable or disable inline editing.
Furthermore, we couldn’t explicitly set the blockVersion through configuration. This issue has been resolved as well.
@dsturm This is maybe outside of the scope of this PR, but how would you implement the new filter acf/blocks/top_toolbar_fields in Block.php? Adding it to the constructor of each block manually?
Hej @aanndryyyy,
good question! I'm not 100% familiar yet with the inline editing feature and still need to find out, what works best.
But currently my first thought on this, would be adding a new array property like topToolbarFields or inlineFields and add the hook in the register callback for the block.
Or should we extend the Log1x\AcfComposer\Builder\FieldBuilder class (since stoutlogic/acf-builder doesn´t support this) to support something like:
$blockFields
->addText('label')
->inline(); // Or `->addToTopbar()`
I'm open to extending FieldBuilder or even a PR to ACF Builder if you think it should be done there. I haven't had time to mess with inline editing yet, really appreciate the push here. 🙌
Hej @Log1x ,
unfortunately I'm currently short on free time - but I'll be gladly working on this as soon as possible.
@Log1x / @dsturm I propose that this PR to be merged, so it's possible to set how good that "auto" mode is. I'll try to find the time to do a PR for the block header level topbar/inline functionality. Already got simple blade components that allow manual adding of text and toolbar inline editing and it's great.