- Issue created by @krishna1406
- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
For new/custom templates to load you need to do a cache rebuild, did you do that?
Yes, I have rebuild cache, theme registry , flushed all the cache as well.
- Status changed to Postponed: needs info
about 1 year ago 7:59am 16 November 2023 - 🇧🇪Belgium BramDriesen Belgium 🇧🇪
I really need some more info to assist you.
Please share your folder structure of your theme where you put the template.
Also doesn't sound like you're using git? Because there would really be no reason for it to work locally but not on your server.
Hi Bram,
Here is my structure of theme \themes\custom\mythemegroup\templates
inside templates poll-meter.html, poll-results.html we have these 2 templates copied from \modules\contrib\poll\templates folder
Unfortunately we are not using GIT to move codes. We have only developed above templates to achieve desired outcome only issues the templates are not able to idnetify by drupal in server as its working in local server.
Also we have tried to enable twig debug and we can see some template suggestions but not sure what would be stopping the templates loading.
- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
Okay, so looks like the template being loaded currently is the one from the Bario Bootstrap theme.
Q; Is your theme properly declared as a subtheme of Bario Bootstrap?
Q: Your custom theme is enabled and set as default?I checked one of my own projects where we themed the poll, here is the structure:
docroot/themes/custom/THEMENAME/templates/poll/poll-meter.html.twig
Only difference I see here is the subfolder "poll", but that normally should have no effect as far as I know.
Twig debug normally has no effect on the templates being detected. This is only solved by a complete cache rebuild, just to rule out any other form of caching. After the Drupal cache rebuild, have you tried incognito? And to rule out things like varnish, add something to the url like
?nocache
so it's treated as a new URL. Hi Bram,
Q; Is your theme properly declared as a subtheme of Bario Bootstrap?
A: Yes, it it propely defined even we have multiple sub themes they are applying for each site as different presentation. Since we are using domain access module.
Q: Your custom theme is enabled and set as default?
A: Yes, My custom theme enabled and set as default.I checked one of my own projects where we themed the poll, here is the structure: docroot/themes/custom/THEMENAME/templates/poll/poll-meter.html.twig
The above method also I have tried to created poll folder inside template but still not luck.
Even the custom content template also not loading - we have created content type "project" and template we have defined as "node--project.html.twig" even this template not loading the same is working in local environment.
- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
Even the custom content template also not loading - we have created content type "project" and template we have defined as "node--project.html.twig" even this template not loading the same is working in local environment.
That would make me believe there is something else wrong on your server. Maybe a theme not enabled or something. But since it's not only the template of this module, this is a more general issue on your site.
Unfortunately we are not using GIT to move codes.
I would highly recommend spending time on that! Managing a project that is live without proper CI/CD or versioning is a nightmare.
- Status changed to Closed: cannot reproduce
9 months ago 9:53am 9 March 2024 - 🇧🇪Belgium BramDriesen Belgium 🇧🇪
Going to close this for now. Feel free to re-open the issue if you are still encountering this.