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.
The help says that by visiting 'administer >> site building >> themes' it's possible to clear the theme cache. This isn't true, at least not on my system: merely visiting that page doesn't call drupal_rebuild_theme_registry() (it's hitting 'Submit' that does).
This patch makes it easier for themers by adding a "Rescan template files" button to the "Theme: Information" section.
I'm attaching a screenshot and a patch.
Comment | File | Size | Author |
---|---|---|---|
#1 | rescan_templates.diff | 3.08 KB | mooffie |
rescan_templates.png | 57.46 KB | mooffie |
Comments
Comment #1
mooffie CreditAttribution: mooffie commented...and the patch.
Comment #2
mooffie CreditAttribution: mooffie commented(I know that in Drupal's lingo the common expression is "clear theme's cache" or "clear the theme registry", but I think that the term "rescan" is easier to understand.)
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted! Thanks for the patch!
Comment #4
mooffie CreditAttribution: mooffie commentedThanks for committing it, I believe it's a valuale feature.
Note, however, that I've found an elusive bug with this button, and published a patch. Sorry for the bother.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
heather CreditAttribution: heather commentedI'm really glad you put this button *somewhere*... because i was getting really frustrated not knowing why my templates were not working... I clicked this button, and was relieved to see that I was not, in fact, crazy.
Now... my only issue is that is it hidden, and hard to find - considering how essential it seems to be. Also even the "important" notice is in grey. This would be a great button to just put all over the place, or mention it everywhere. Not sure where else would be a good place... while looking for a solution to my problem, I tried several places over the course of 3 hours...
- I looked on Drupal.org, google (but didn't know what was wrong so this didn't help)
- I looked on the views list page for some indication of "oh you made some templates, and they're not apparently working? click here- all your problems solved.
- I also looked in the readme.txt of views
- and I looked on the editing screen of the view itself... many many times... before even noticing the "Theme Information" options... and even then, I didn't see the great little button for several tries, messing around with the different options and theme examples...
I have advanced help installed, but nothing came up.
OR... how about an additional THEME-README.txt file? with something like:
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedheather: Here is the awesomest part.
I've already done almost precisely what you ask. Check this out.
There's a help topic entitled Using Views templates.
This topic lists the most important things you need to know about templates. Including:
Comment #8
merlinofchaos CreditAttribution: merlinofchaos commentedComment #9
heather CreditAttribution: heather commentedwo0t!! i see it now :)
the thing is, anubi like me, i didn't know what my problem was... so although i went to the handbook... i didn't see the solution. and of course, just installing advanced help, this mention didn't appear to me when i needed it.
i'd still be in favor of mentioning this fact on the views list page, in context, just like the modules page points out:
something like:
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.