palmiak / timber-acf-wp-blocks

Create Gutenberg blocks from Twig templates and ACF fields.
https://palmiak.github.io/timber-acf-wp-blocks/
MIT License
243 stars 25 forks source link

Pass options to innerblocks #32

Closed landwire closed 4 years ago

landwire commented 4 years ago

Hi there, I am having trouble passing options to an innerBlock. Do you have any idea, how to do it? Or would it have to be an option in the top area, where all the options are passed to the block?

I tried this in my template and many other variations, but nothing worked.

{% autoescape false %} <InnerBlocks allowedBlocks="{{ "['core/paragraph']" | json_encode }}" /> {% endautoescape %} I get this: string(21) ""['core\/paragraph']""

Problem is likely some escaping, but I do not know.

palmiak commented 4 years ago

Take a look here - https://github.com/palmiak/timber-acf-wp-blocks/issues/27

I think I'll add a Twig filter to make i simpler :)

landwire commented 4 years ago

Maciej, thanks so much! I tried escape but not escape(‘html_attributes’).

Also good to know about the 0 height problem!