Sub-theme of Sub-theme? Best Practice advice sought.

WarrenK's picture

I've been playing with a distribution that includes Zen and a Zen sub-theme. I wrote some custom tpl and css files and then in a moment of sheer stupidity upgraded the distribution. Of course my custom files were wiped out in the upgrade and of course I had not archived them in Git. No real harm done because it was a sandbox-type project but it begs the question which I hereby pose to you: is it possible to create a sub-theme of a sub-theme? Is doing so a good practice or not? How does one, and should one, upgrade a distribution without overwriting any modifications?

TIA for all guidance rendered.

Comments

Subtheme of the Base theme in theme folder?

jhenson's picture

I'm not too sure about making a sub theme of a sub theme, though I believe the documentation for themeing actually covers a bit of it, but can't you just make a sub theme of the base theme in your themes folder. For instance, when I use Adaptive Themes as my base, I copy the Subtheme included with it in my /sites/thesite.com/themes folder. Then I make the changes to the info file's name, description, etc and use it. I also place all site specific modules I create in the /sites/thesite.com/modules folder.
I would think that even if/when you upgrade your distribution it wouldn't touch your 'thesite.com' folder so all your custom theme, modules, libraries would be intact. The other nice thing about keeping site specific stuff in the /sites/thesite.com/ folder is git, you can just check in the whole folder (well maybe exclude the files folder but thats up to you).

Subtheme was in Profiles folder

WarrenK's picture

Several issues here, it appears.

My first mistake, I think, was to work with (modify existing files/create new files) the new subtheme where it was delivered and installed, which was in the /profiles folder (this was my first time working with a subtheme delivered as part of a distribution.) At the time I asked the people who provided the distribution if I should move the files from /profiles to /sites, and the advice I received was that it made no difference whether the files lived in /profiles or in /sites. Obviously it does make a difference! But at the time I took the advice at face value and experimented in the /profiles folder.

I have a question, however, about your suggestion to copy the subtheme from the distribution in /profiles to /sites. If the people providing the distribution change the subtheme files then any changes/improvements made to those subtheme files would not be reflected in my copy of the subtheme, residing in /sites. How would you deal with that? A Git merge? Manual diffs?

Thanks. This has been an interesting learning experience about a facet of Drupal development that I have not previously encountered.

Seattle

Group organizers

Group events

Add to calendar

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week