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 24 forks source link

Use timber-acf-wp-blocks with TwigStackExtension #53

Open merijnponzo opened 3 years ago

merijnponzo commented 3 years ago

Hello,

Instead of using EnqueueScript i would rather 'stack' my javascript from each .twig block and push it to the footer (inline) Similar to blades '@stack' function i tested twig-stack-extension https://github.com/filhocodes/twig-stack-extension but it's not working with the timber-acf-wp-blocks.

My guess is that like the twig-stack-extension says:

This extension allows you to define a section of a "base template" that will receive contents from all the other pages, either via include, embed or extends.

The twig-stack-extension is not triggered within the timber-acf-wp-blocks.php

Timber::render( $paths, $context );

Any ideas how scripts within the blocks could be stacked and outputted inline within the footer like this example

Would be super awesome

palmiak commented 3 years ago

This looks really amazing, but because we rely on Timber I think we should think a bit more about integrating this feature into Timber (or creating an add-on for it).

Than Timber ACF Blocks should work with this out of the box.

merijnponzo commented 3 years ago

True story, great plugin! Thanks