Themes and Sub-Themes

1 reply [Last post]
Last seen: 10 years 21 weeks ago
Joined: 2011-06-04

Just completed Chapter 4 of the Drupal Themes video series and it was extremely helpful for my specific implementation scenario. But I wanted to make sure I'm looking at this correctly before I go down this path fully.

I'm building a platform that will allow me to license 'content' to third party websites. That content will be delivered on a SaaS basis and the content provided will be able to be 'themed' or branded to match the third party website branding standards. I'll setup each website using the multi-site capabilities of Drupal with subdomains (i.e., I've created a base theme to deliver the content and individual modules for separately licensed units. So far so good.

Now, if I understand sub-themes correctly, when I setup each licensee, I should be able run them off a single instance of the base theme that will be in the sites/all/themes folder. If I then create a sub-theme and place that sub-theme in a sites/'licensee'/themes folder, I should be able to just do the individual branding/customizations that the licensee would like to see without impacting the main theme. Is that correct?

If that is true, I would just setup the sub-theme .info file with basic 'scaffolding' to make it easy for these changes to be implemented. One question I do have is if, for example, I want to change styling of individual elements, will my style.css file replace the style.css file in the base theme, or will it just override it... meaning if my sub-theme only uses a different background color, that would be the only change I would make to the style.css file in the subtheme folder, with the rest of the base theme settings still being applied. Is this all correct?

One final question. I'm using the template.php file to load individual javascript files for each individual module. Does the template.php file, if placed in the sub-theme directory completely replace the template.php file from the base theme, or does it just execute after the base theme? I'm asking because I might have the need to replace a base them javascript file with a sub-theme javascript file and I'm wondering how that would work.

Last seen: 10 years 10 weeks ago
Joined: 2011-02-28
You should explore

You should explore documentation for the drupal_add_css() and drupal_add_js() functions. They might be essential to what you are trying to accomplish. Rethink your solution around these and you may come up with a simpler solution.

Add to playlist

Add to , or

Add to new playlist:

Add to playlist
This is a member-only feature
But, it's easy to become a member

Add to cart:

Contact us

Below are the supported keyboard shortcuts for our video player.

Start / stop video
Go to next video
Go to previous video
Increase or decrease player speed by 20%
Skip ahead or go back by 15 seconds
Jump to a percentage (2 is 20%, for example)
Toggle full screen
Videos Pricing More Search
BuildAModule Logo Icon BuildAModule Logo Icon
Become a member!
1 month
6 months
10% off
12 months
20% off
All memberships come with the following:
24 / 7 access to the entire 1800+ video library
An innovative video player with a rolling transcript
Extensive Drupal and cross-platform training
A thorough and thoughtful training style
Progress tracking
Take notes on specific video sections
Intuitive multi-user management
How many users?
Go solo with a single user, or give multiple team members access through one account and get discounts by bundling multiple users into a single membership.