Is it possible to create a subtheme for the core Drupal Seven theme (in drupal 7)? If so, how do I do this? I had already tried to do it a few months ago to override the templates for Simplenews but it wasn't working.

  • Is there a reason you want your Seven sub theme in the seven theme directory (as opposed to a subfolder in your sites/ dir)? – Shawn Conn May 19 '16 at 18:34
  • I did not understand your comment. I want to apply custom templates to seven theme, how to do this? I do not want to change the heart of drupal – user54067 May 20 '16 at 15:43
  • I think I misunderstood your question. So you're asking how to create a sub theme for the core Seven theme? – Shawn Conn May 20 '16 at 15:52
  • yes that's what I want done – user54067 May 20 '16 at 16:29

Creating a sub-theme is pretty basic:

  1. Create a sub-dir for your themes in your configured sites dir (e.g. sites/default/all/my_subtheme).
  2. Copy over the .info file of the theme you want to subtheme (e.g. themes/seven/seven.info) to your new theme directory with it renamed to match your directory (e.g. sites/default/all/my_subtheme/my_subtheme.info).
  3. Edit your sub theme .info so that it also contains the line base theme = seven. You can optionally give it another name or description.

From there you should be able to enabled it and start using it. You can copy over other resources that you'd like override in your subtheme. In your example, you can create templates subdirectory (e.g. sites/default/all/my_subtheme/templates) and copy the simplenews templates that you wish to override.

  • thank you, it worked. I forgot the line "base theme = seven" – user54067 May 22 '16 at 20:26
  • Thanks for this... but just to make it clear, having your custom themes base theme as seven will inherit all the latest drupal / seven core updates? Thanks in advance! – cwiggo May 8 '17 at 14:27

Your Answer

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