I have installed the domain key module into a group of sites administered with unique code and db using the module http://drupal.org/project/domain (domain access) but it look that I can use it only on main domain and not on my subdomain www.gmsedie.com where I want to show marineli theme with different headers on base of section where surfers are (1 type per frontpage and generic places and other 4 themes for the 4 product lines).

Comments

mkalkbrenner’s picture

How do you try switching the theme? Which path or property and conditions are you using?

Please try this:
Install ThemeKey Properties and use property system:server_name to switch the theme.

mkalkbrenner’s picture

Status: Active » Postponed (maintainer needs more info)
Carsten Müller’s picture

Category: support » bug

With the module domain (access) it is possible to handle multiple (sub)domains on one site including the access handling etc.
If installed for each subdomain a special front page is created so that the property "is_front_page" does not work any more, because when entering the front page of the subdomain this is also a frontpage. So there are multiple front pages and if entering one of them every time the method "is_front_page" returns true.

Better solution to switc the theme is to use the "system.host" property, so the theme will be switched for the whole domain.
If just the front page look should change the node id (nid) has to be used by now. If there is no nid there is no at the moment no solution to handle this.

iancawthorne’s picture

I have the same issue and have tried the suggestion at #1 but it looks like the domain access module is still overriding this setting, but it does work for the primary domain, just not any additional ones.

Here is what I have set up :

In domain module: domain_a (primary) uses theme_1 and domain_b uses theme 2.

In this example, one node of each domain uses a different theme.
domain_a node/1 uses theme_1a - using themekey (without themekey_properties), set node-nid = 1 to use theme_1a instead of the default theme_1/ This works fine.

But then...
domain_b node/2 I want to use theme_2a. Using the above logic, rather than using theme_2a I still get theme_2.

If I use the theme_key properties, I do the following:
system_host = domain_b
nested inside this node-nid = 2 use theme_2a

I still get theme_2 instead of theme_2a.

It looks like the domain access module overwrites theme_key, but only for none primary domains. Unless I have missed something?

iancawthorne’s picture

I should add that I have tried changing the weight of the modules so that theme key and theme kay properties are heavier than the domain module, but this makes no difference.

Danny Englander’s picture

I seem to be having the same issue as well. To clarify when inputting system:server_name do I use subdomain.example.com for "=" to if I want to change themes for that sub domain? (I also tried system:host but that did not work either.

mkalkbrenner’s picture

Version: 6.x-1.2-beta6 » 6.x-3.x-dev

To help us solving the issue:
1. Upgrade to ThemeKey 6.x-3.0
2. Enable the module ThemeKey Debug
3. Select "Show ThemeKey properties values" at /admin/settings/themekey/settings/debug
4. Click through your sites and see the values for system:server_name and post the results here

Danny Englander’s picture

I followed the steps in #7 and server_name and host were both as I expected for my sub-domain: subdomain.example.com However, when I input that value for a simple theme change it has no effect. I can however do a theme switch for my main domain (example.com) so I know it's working somewhat, it's just not passing values to a sub domain using domain access.

I just noticed something interesting however, I had the domain access module "domain theme" enabled and once I disabled that, theme key started working for my sub-domain but I don't think this is any good because I need to have separate logos for sub domains. I was only using theme key to do a switch for anonymous users (user ID 0) so it seems like I might not be able to use theme key with the domain theme module together?

mkalkbrenner’s picture

I had the domain access module "domain theme" enabled and once I disabled that, theme key started working for my sub-domain but I don't think this is any good because I need to have separate logos for sub domains.

That's a good hint. If you activate "Trace ThemeKey rule switching" at /admin/settings/themekey/settings/debug you should see some information about this.

If "domain theme" switches real themes it should be possible to emulate that behavior using ThemeKey rules.

mkalkbrenner’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Needs review

I had a look at the code ode domain_theme.module. This causes the trouble:

/**
 * Implement hook_init()
 */
function domain_theme_init() {
  // Assign the theme selected, based on the active domain.
  global $_domain, $custom_theme;
  // If the theme has already been set (such as an admin theme), only load settings.
  if (empty($custom_theme)) {
    $theme = domain_theme_lookup($_domain['domain_id']);
  }
  else {
    $theme = domain_theme_lookup($_domain['domain_id'], $custom_theme);
  }
  // The above returns -1 on failure.
  if ($theme != -1) {
    // Set our domain-specific theme.
    if (empty($custom_theme)) {
      $custom_theme = $theme['theme'];
    }
    domain_theme_set_variables($theme);
  }
}

But there should be a solution:
1. Create ThemeKey rules that pick the right theme for each domain.
2. Adjust the module weight of ThemeKey to run before domain_theme.

Now ThemeKey should set $custom_theme to the right value and domain_theme should only set the variables.

Danny Englander’s picture

Adjust the module weight of ThemeKey to run before domain_theme.

How does one adjust module weights in Drupal 6?

mkalkbrenner’s picture

You can modify the weight directly in the database or using this module:
http://drupal.org/project/util

Danny Englander’s picture

@mkalkbrenner -- ok that seems to have done the trick using the Util module and adjusting module weights. (A very nice module at that, will come in handy for sure). **Note, in case someone else runs up against this, I gave domain_theme a weight of 100 and left themekey alone and saved the modules page.

I can now use domain theme and theme key together though I did see your comment in #9 about using theme key rules instead of domain theme so I'll have to play around with all that but in the mean time my issue is solved thanks for the help!

vigneshbabu’s picture

Hi,

I would like to know some more information about using this module it looks really amazing. I searched for the documentation/ Tutorials but only found how to setup the Theme Switching Rule Chain but i dont know how to configure/settings part of the module. Please help me here ..,

I am using two themes for a website with multiple books in it. I want to display different themes for different books when anonymous user flips over to different books it should automatically change to the concerned theme. how can I achieve this using this module

expecting your guidance

Thanking you in advance
vignesh

mkalkbrenner’s picture

Every book has it's own id (bid). So you can setup a rules like
book:bid = 27 >>> Special_Theme

If you enable the ThemeKey Debug Module and activate "Show values of ThemeKey properties" at "/admin/settings/themekey/settings/debug", you'll see the current value of book:bid at the footer of every page. By clicking on the value you can easily create such rules.

BTW your post is off topic in this issue. Please open a dedicated support request next time.

vigneshbabu’s picture

Hi,

Sorry for posting it in wrong area. I am a new user to Drupal and couldn't find where to post general discussions. I will correct this from next time, Thank you for the information provided :)

I had already tried using the book id, In my case it picks up the right book id following the rules but It doesn't pickup the correct theme which is setup as part of the rule. I get an error message saying something like "Already some other module had initialized the theme, $theme is overridden" may I know how can I deal with this?

Once again thanking you in advance,
Vignesh

mkalkbrenner’s picture

Unfortunately this is a common problem in drupal 6.

Please read through this issue:
#754970: Skipped rule checking because another module already initialized the theme engine

vigneshbabu’s picture

Hi,

Once again thank you for the quick reply. I will look through it

-Vignesh

mkalkbrenner’s picture

Status: Needs review » Closed (fixed)