Closed landwire closed 2 years ago
Sorry it took so long - first the vacation, than lot's of work.
The use fix will be added in a fix today. I really like the idea of including the data_processor. I have to think about it especially that personally I'm using the timber/acf-gutenberg-blocks-data
sometimes for adding some default stuff.
I have one idea but before I'll explain it could you first help me a bit:
Because I'm thinking about a separate mode, let's call it for now ComponentBlock - and if it would be set to true it would be default tried to enqueue a style, a script, and a php file.
Hi Maciej, this would be a simple textMedia Block. As I have a seperate FE that I can serve with any CMS (Drupal, Wordpress, TYPO3), I am just including another twig file with the data:
{#
Title: Text Media
Description: Displays media and text
Category: formatting
Icon: editor-ul
Keywords: image images
Mode: auto
SupportsAlign: left right
SupportsMode: false
SupportsMultiple: true
#}
<section class="wp-block wp-block-textMedia">
<div class="wp-block__inner-container">
{% include '@textmedia' with textMedia %}
</div>
</section>
At the moment I have: CSS: is one big file for the project JS: I have several bundles according to functionality/components for the project
So it's more of the "merging into one" approach at the moment. But I am using a globber to pull all the .scss and .js files together and let gulp/webpack run over them. So I would not need a full "ComponentBlock" mode or a componentBlock mode with parameters on what to include (css, js, php).
Please let me know if you consider adding those extra parameters into the filter or plan to solve it a different way. Thanks!
Hi Maciej, any more news/ideas on this? Shall I rename those filters, so we keep backward compatibility? Any other info you need from me?
I close this for now and maybe make a new proposal :-)
Hi Maciej, I needed some other filters in your plugin to make it work with my directory structure of blocks.
I then use the filters as such in my functions.php. This one to add the data to the $context for that component:
and this one to remove all other directories that have nothing to do with that component:
I also removed the use statements as they threw an error in my php version (7.3). Would be grateful if you would consider adding those filters. Obviously the timber/acf-gutenberg-blocks-data filter would not be backwards compatible. Unless you want to call it something else and keep the original filter. Or maybe there is another way...