Theme Reference

Component ID

1957608

Component name

Theme Reference

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

1722

Component created

Component changed

Component body

Provides a theme reference field.

How can I change the current theme based on the theme selected for a node?

/**
 * Implements hook_custom_theme().
 */
function MODULE_custom_theme() {
  // set the theme based on field_article_theme
  $node = menu_get_object();
  if (isset($node->field_article_theme[LANGUAGE_NONE][0]['name'])) {
    $theme = $node->field_article_theme[LANGUAGE_NONE][0]['name'];
    return $theme;
  }
}