-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with extending blocks / creating new blocks in child theme #57
Comments
I think it may be related to the fact I'm using locate_template. Could I ask you for a zip with simplest example of your case? |
Thanks for your swift response! Due to the privacy of the code- I had to recreate this with the bare bones, but left some comments to help illustrate. This only contains the parent and child themes, with the assumptions you have ACF Pro and Timber installed on your setup. Timber ACF WP Blocks is included via composer. Hopefully this works for you! |
Hi @palmiak, just wanted to follow up on this. IWhen using the filter to create a custom directory to find the blocks, I was actually able to create new blocks in the child by passing an array (one element being a full path) in the Parent theme like so:
However, this still leaves all of the parent theme blocks broken and I'm unable to extend the blocks in to the child. Im looking in to the locate_template route you mentioned, so if I have any ideas I'll let you know! Hope this helps and thanks again, |
Sorry to keep pinging, played around with the locate_template function and did find that that could be the culprit. I'm not a PHP expert, but combining this filter that adds the directory paths
And removing the
Does allow me to create new blocks in the Child theme while retaining the ones in the Parent! However, I don't know the implications of changing this, as we wouldn't want to have others be forced to provide that directory path in the filter. Using a
Let me know your thoughts! |
Seeing now that this doesn't work if not using the filter, I'll keep at it and open a PR :) |
Hi there! Firstly, I love this plugin.
Some background - I'm using the Timber Starter Theme as the parent, with ACF, Timber, and Timber-ACF-WP-Blocks installed via Composer.
I don't know if this is an issue with the composer package, but it seems I'm unable to do the following things in regards to a Parent/Child theme setup:
A.) Cannot create another view/blocks directory in the child theme (the parent views/blocks directory becomes completely unavailable.)
B.) Cannot register new blocks if I install the package through composer again in the Child theme directory root (likely a symptom of point A.)
C.) Cannot extend block twig files in the child theme even when using the Timber loader to create a namespace for the blocks themselves (like a symptoms of point A. as well.)
I am able to create blocks putting the acf_register_block_type() function directly in to the Child functions.php and register new blocks. As long as I do not create a directory of views/blocks in the child, these new registers work fine.
Any help on this would be greatly appreciated!
The text was updated successfully, but these errors were encountered: