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.

CommentFileSizeAuthor
#1 rescan_templates.diff3.08 KBmooffie
rescan_templates.png57.46 KBmooffie
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mooffie’s picture

FileSize
3.08 KB

...and the patch.

mooffie’s picture

(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.)

merlinofchaos’s picture

Status: Needs review » Fixed

Committed! Thanks for the patch!

mooffie’s picture

Thanks 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.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

heather’s picture

Status: Closed (fixed) » Active

I'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:

Tips on creating templates for your views:

In "Edit view" page, under Basic Settings, select Theme: Information.

Theming information lists all possible templates for displaying your theme. You can use the file names there as a guide to naming your theme templates.

Important: When you create a new template you need to "Rescan template files" for changes to be reflected.

Scroll down on Theme: Information and click "Rescan template files" button

merlinofchaos’s picture

heather: 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:

2. Clear the theme registry. See the instructions for how to do this.

This links to http://drupal.org/node/173880#theme-registry

It also includes pretty much all the other information you suggest, and more.

merlinofchaos’s picture

Status: Active » Fixed
heather’s picture

wo0t!! 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:

It is important that update.php is run every time a module is updated to a newer version.

something like:

Remember to clear the theme registry when adding or removing theme functions and templates.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.