I see there was a previous post about sub-sub-theming, but I don't think the issue was resolved (mainly due to a lack of info about the issue) so I'd like to expand on this issue. I have a multisite setup going, where multiple similar sites share a theme. I would like to tweak the theme of just one of these multisite installs, so had hoped to subtheme the subtheme that is running on all of the multisites. Here is the general setup:

My subtheme is a subtheme of the adaptive theme:
sites > all > themes > general_multisite_subtheme
sites > all > themes > adaptivetheme

My multisite installation is as follows:
sites > siteA > themes > site_specific_subtheme

So I would like site_specific_subtheme to inherit everything from general_multisite_subtheme, which inherits from adaptivetheme.

So far I have tried the following:
I have tried creating a site_specific_subtheme per Adaptive Theme's instructions at http://adaptivethemes.com/documentation/sub-theme-setup, where I copy sites > all > themes > adaptivetheme > at_subtheme to sites > siteA > themes > site_specific_subtheme (I rename at_subtheme to site_specific_subtheme) and make all of the necessary changes in the .info file. I have tried changing the base_theme setting in my site_specific_subtheme.info file to both general_multisite_subtheme and adaptivetheme (just tried this in case), and neither of these work. By not working, I mean they pick up none of the theming from the general_multisite_subtheme. It is picking up modifications I made to the original subtheme's template files at sites > all > themes > general_multisite_subtheme > templates > page.tpl.php, but none of the css is being applied.

I have also tried creating my site_specific_subtheme (sub-theme of sub-theme) per https://drupal.org/node/225125, which actually specifically mentions that this should work for multisite situations just like the one I have going on. In this case, I created a new empty theme directory at sites > siteA > themes > site_specific_subtheme, and declared site_specific_subtheme.info within this directory. This site_specific_subtheme.info was a copy of sites > all > themes > general_multisite_subtheme > general_multisite_subtheme.info, and in this .info file I changed the base_theme for my site_specific_subtheme to general_multisite_subtheme. I also created an empty site_specific_subtheme.css file and referenced this file in my site_specific_subtheme.info as stylesheets[all][] = site_specific_subtheme.css. I also tried referencing this css file as stylesheets[screen][] = site_specific_subtheme.css. This didn't work either - none of the theming from the general_multisite_subtheme is applied when I enabled and set to default my site_specific_subtheme. Likewise, changes to template files in sites > all > themes > general_multisite_subtheme > templates > page.tpl.php are applied, but no css is applied.

I know this is a bit of an edge case, but I thought subtheming a subtheme should work based on general Drupal docs, and it doesn't seem to be true for a subtheme of a subtheme of Adaptive theme. Any thoughts as to why this might be the case?

Comments

kbrinner’s picture

Upon further work on my setup I realized the following:

To get most of the CSS to inherit, when using AT_subtheme as my starter subtheme in sites > siteA > themes > site_specific_subtheme, in the site_specific_subtheme.info I needed to remove reference to any other stylesheets except for stylesheets[all][] = site_specific_subtheme.css (no duh). When I left in the references to stylesheets[screen][] = css/global.base.css and stylesheets[screen][] = css/global.styles.css that were from the AT_subtheme, these would of course 'erase' any changes I made to the same files in the general_multisite_subtheme.

Changes to template.php and theme-settings.php are being being inherited with a glitch. I have used the template.php and theme-settings.php to create schemes which allow users to select 'color schemes' and chose a font for the theme. I can see the font size, font, and color scheme selection options in the settings of my site_specific_subtheme, but when I try to change the font or color in the theme settings, the changes are not being applied.

sites > all > themes > general_multisite_subtheme > template.php:

/**
 * Overrride or insert variables into the html template
 * used for style themes
 */

function general_multisite_subtheme_process_html(&$vars) {
  //Add classes for the font styles
  $classes = explode(' ', $vars['classes']);
  $classes[] = theme_get_setting('font_family');
  $classes[] = theme_get_setting('font_size');
  $vars['classes'] = trim(implode(' ', $classes));
}

function get_at_styles() {
  $scheme = theme_get_setting('style_schemes');
  if (!$scheme) {
    $scheme = 'style-default.css';
  }
  if (isset($_COOKIE["atstyles"])) {
    $scheme = $_COOKIE["atstyles"];
  }
  return $scheme;
}

$style = get_at_styles();
if ($style != 'none') {
  drupal_add_css(path_to_theme() . '/css/schemes/' . $style, array(
    'group' => CSS_THEME,
    'preprocess' => TRUE,
    )
  );
}
kbrinner’s picture

Status: Active » Closed (fixed)

I'm having a nice conversation with myself, aren't I? Hopefully this will help someone else down the road. In order to get the color schemes to change when adjusting them in the settings of site_specific_subtheme, I needed to copy all of the scheme files from sites > all > themes > general_multisite_subtheme > css > schemes to site_specific_subtheme > css > schemes and then color changing works fine. I'll mark this as closed as I appear to be trouble shooting this on my own :)

kbrinner’s picture

Issue summary: View changes

added info about template files being picked up, but no css is applied to the subtheme of the subtheme.

Exploratus’s picture

I am interested in this. I have a subtheme of adaptive theme, and I want to create a subtheme of that for a sub site that will have a similar look. Where you successful in the end?