This issue is similar to http://drupal.org/node/633194

We have a site with a few domains via the domain access module. Those domains all share a common theme for a section of the site so we use themekey to set that theme. This works fine except the theme settings need to be slightly different for each domain (eg the logo) - we use the domain_theme module for that.

The problem is, the domain_theme module only sets the settings for the theme it thinks should be applied (ie the one set to that domain). Attaching a patch that allows themekey to use the domain specific settings for the theme it applies.

CommentFileSizeAuthor
domain_theme_support.patch637 bytesmjpa
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mkalkbrenner’s picture

Version: 7.x-2.3 » 7.x-2.x-dev
Status: Needs review » Needs work

The patch doesn't look bad, but I won't accept it like it is.
Instead of a hard coded dependency I will offer a new hook to take actions after a theme is selected in ThemeKey 7.x-3.x.

mjpa’s picture

There is no dependency... would you add the hook to 2.x? Although that means the domain module having to be modified to support ThemeKey instead...

mkalkbrenner’s picture

Status: Needs work » Needs review

I adjusted your code to use the new hook and committed it to ThemeKey 7.x-3.x:
http://drupalcode.org/project/themekey.git/commitdiff/e5ad379?hp=63f662d...

Can you test it?

The release of ThemeKey 7.x-3.0-alpha1 will happen as soon as you provide some feedback. Due to the API change and the experimental support of fields it will be an alpha release. But as long as you don't create rules for fields, the alpha release should be stable as 7.x-2.x.

mjpa’s picture

Status: Needs review » Needs work

Is there a module called "themekey_domain_theme" because I don't see one.... and so don't see how that hook would get called...

mkalkbrenner’s picture

Status: Needs work » Needs review

There's no module called themekey_domain_theme.
All plugins / inc files in the modules folder of themekey use "pseudo" hooks using the naming pattern "themekey_ MODULE_NAME _ HOOK".
They automatically turn active as soon as a module like domian_theme is enabled.

Here you can see the delegation for hook_themekey_custom_theme_alter():

/**
 * Implements hook_themekey_custom_theme_alter().
 * Delegates to pseudo hooks in ThemeKey's module plugins.
 */
function themekey_themekey_custom_theme_alter(&$custom_theme, $rules_matched) {
  $modules = & drupal_static('themekey_modules', array());

  foreach ($modules as $module) {
    $function = 'themekey_' . $module . '_themekey_custom_theme_alter';
    if (function_exists($function)) {
      $function($custom_theme, $rules_matched);
    }
  }
}
mkalkbrenner’s picture

Any feedback?

mkalkbrenner’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.