I've installed a theme on my site, and can't figure for the life of me how to extend the theme to different content.

For example, comments are themed on the blog pages; however, when I add new content types with comments, the theme is not applied to these comments.

How do I get the theme to extend to the different content types?

  • 1
    Seems you have override your theming work for blog content type. To use common theming, you have to change in common template file. Feb 24 '15 at 8:10

Worked this one out after a bit of fiddling, so for others trying to figure it out too...

  1. First find the template file you need to override - if it's part of a module, it might be in the module templates folder. Otherwise install Theme Developer - it will help you track down the template that's being used for that content https://www.drupal.org/project/devel_themer
  2. Chances are you'll need to override that template with one from your theme - identify the template theme that you want to use (easiest done using Theme Developer on the page that is coming up how you want), then copy that template file from your theme templates folder ([theme].tpl.php) to your sub-theme templates folder
  3. Rename the template file in your sub-theme templates folder the same as the one you want to override (as identified in step 1), and voila.
  4. (optional) you might find a CSS file somewhere is still screwing up the way your content looks (in my case it was in the module css folder) - you can either tweak it with other tools like CSS Injector, or copy the offending CSS file into your sub-theme css folder and tweak it there.
  5. If you are overriding CSS, you'll need to identify the CSS file in the sub-theme .info file (found in your sub-theme folder) - add the following line: stylesheets[all][] = css/filename.css (where filename.css is the name of the tweaked CSS file) under the line stylesheets[all][] = css/custom.css

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.