getThemeDefaultBlockTemplates() not working anymore?
Permalink
Is it possible that the public function getThemeDefaultBlockTemplates() in page_theme.php of a theme package doesn't work anymore in 8.4.x?
Maybe a change in syntax that i've been missing?
The code that previously worked looks like that:
Just to clarify, the path to my custom block template for "file" in the example above is:
Namespacing in page_theme.php is ok, it has not been changed since default block templates worked.
Can't tell exactly when it stopped working, i think it happened after one of a concrete5 8.3.x or 8.4.0RCx update.
Maybe a change in syntax that i've been missing?
The code that previously worked looks like that:
public function getThemeDefaultBlockTemplates() { return array( 'autonav' => 'custom_nav', 'next_previous' => 'custom_next_prev', 'file' => 'custom_file', ); }
Just to clarify, the path to my custom block template for "file" in the example above is:
packages/my_theme_package/blocks/file/templates/custom_file/view.php
Namespacing in page_theme.php is ok, it has not been changed since default block templates worked.
Can't tell exactly when it stopped working, i think it happened after one of a concrete5 8.3.x or 8.4.0RCx update.
Just to make sure: it's about setting a custom template as the default one in page_theme.php, not about custom templates in general. Are you definitely experiencing that you defined one of available block templates as default in page_theme.php and that didn't work?
Anyone else can confirm this too?
Thank you!
Anyone else can confirm this too?
Thank you!
No, I was talking only abaout custom block templates.
Maybe the answer to your issue is here
https://github.com/concrete5/concrete5/pull/6456...
All the best,
V.
Maybe the answer to your issue is here
https://github.com/concrete5/concrete5/pull/6456...
All the best,
V.
So you mean that this PR changed the syntax of this function, thus it doesn't work anymore?
I don't know if this will help but be aware that those templates will only apply to blocks added AFTER they are defined.
If you have blocks already added to your page and you then define those templates in your theme's function, they won't apply. They will only apply to newly added blocks.
If you have blocks already added to your page and you then define those templates in your theme's function, they won't apply. They will only apply to newly added blocks.
Yes, i'm aware of this.
@okapi I thin @byvictoria is correct
I think you can fix it by modifying the file concrete/src/Page/Page.php. At line 2267 you will see
Move the unset() to be inside the if block and it should fix the problem until the core team fixes it. I left them a message for that on that PR page. If you can confirm my code fixes it, maybe you can also comment there?
I think you can fix it by modifying the file concrete/src/Page/Page.php. At line 2267 you will see
Move the unset() to be inside the if block and it should fix the problem until the core team fixes it. I left them a message for that on that PR page. If you can confirm my code fixes it, maybe you can also comment there?
@mnakalay
Yeah, this resolves the issue! Thank you!
Yeah, this resolves the issue! Thank you!
Thank you!