You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...we've noticed that in the theme_preprocess_page function of any theme, the array $variables['theme_hook_suggestions'] is empty by default. In Drupal 7, we used to check which page template is currently used, add new ones if needed, and create that template file. For example, add a template like this: $variables['theme_hook_suggestions'][] = 'page__user__login', and then create the file page--user--login.tpl.php.
Do you know how can we control the theme_hook_suggestions array in Backdrop? We'd like to avoid building a Layout for each page.
...
The problem is that in D7 we have templates in a "page" level. This is what I get with devel:
<!-- FILE NAME SUGGESTIONS:
x page--user--login.tpl.php
* page--user.tpl.php
* page.tpl.php
-->
But in Backdrop there're no templates in "page" level, we can only change the Layout and the Block templates:
<!-- FILE NAME SUGGESTIONS:
x layout--boxton.tpl.php
* layout.tpl.php
-->
I guess this is how it works in BD, so all page templates that were working in D7 have to be ported as layouts.
...looking at older issues in the core queue, such as this one here makes be believe that you will need to replace your HOOK_preprocess_page() functions with HOOK_preprocess_layout() (or move the theme suggestions over to that hook implementation instead). Can you please have a look at the suggested code snippet over in that link and let me know if that works for you?
The discussion is still on-going, however, I thought that I should capture this here, so we can eventually return here and document this for posterity. Perhaps somewhere in https://docs.backdropcms.org/converting-themes(?).
The text was updated successfully, but these errors were encountered:
What are you trying to accomplish @oriol Roger? Our suggestions will depend on your goals and there will be different ways to accomplish them. Everything is blocks in layouts so you will either have to create more layouts or modify block templates, whether it be the user/login or user/* pages and so on.
Or it could be a new block that takes the context of those paths and then displays something else. There's no one answer.
This came up in Zulip:
Oriol Roger:
@yorkshire-pudding:
Oriol Roger:
@klonos:
The discussion is still on-going, however, I thought that I should capture this here, so we can eventually return here and document this for posterity. Perhaps somewhere in https://docs.backdropcms.org/converting-themes(?).
The text was updated successfully, but these errors were encountered: