Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By CaDyMaN on
Hi ,
I have an entity named offer
I register a theme for it with theme_hook.
How i tell drupal to load the theme from theme folder if exit and if is not from my module theme folder.
Right now is loading only from my module theme folder.
Thanks.
Comments
It already does this by
It already does this by default.
For me it dose not.
For me it dose not.
I thought so myself that already does this by default.
Then there are three
Then there are three possibilities:
1) You need to clear your Drupal cache
2) You've overridden the functionality somehow. Maybe you implemented hook_theme_registry_alter() somewhere.
3) You haven't properly overridden the function/template in your theme. Check for spelling errors.
Solved
Around 11 month ago I had this problem.
In fact i have the below code :
My expectation was that Drupal will search the template by name or path in the main theme folder but it did not.
In fact it search the template by key name.
In order to load the template from my theme folder I should create the file like cc_coupons.tpl.php the key name not the template value.
So nice :)