Other Things You Should Know About Base Themes
Now that you’ve gotten the hang of editing your theme’s .info file and making a child theme, there are a couple of other things that you should bear in mind when working:
Clear the Theme Registry!
Any time you add a new element to your .info
file—whether it’s to add a new region to your page, or add a new
stylesheet (for example, I sometimes like to add a separate stylesheet
for the navigation on sites with complex navigation styles),
you must clear your theme registry. Sometimes, for
really sticky issues, you can also try clearing all of the caches. You
can clear all caches by going into
Configuration→Performance and pressing the “Clear
all Caches” button. If you’re feeling super nerdy, you can also use the
command drush cc all to clear the
caches from within Drush, the command line tool for Drupal. We’ll
discuss Drush in the next book, Drupal
Development Tricks for Designers (cue evil
laughing).
Note
You don’t have to clear the cache every time you do something simple, like changing the CSS in your theme; but if you make a change and nothing happens, clearing the cache will often help.
Working with Regions
Regions are Drupal’s way of laying out containers for content in a given theme. Many themes, such as Bartik and Omega, come with a copious volume of regions—all with odd names like “Triptych,” “Postscript,” and “Preface”—for your block organization pleasure. This is, in fact, one of the things you want in a base theme—the more regions ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access