Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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;
}
}
Supporting organizations:
Project information
- Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - 12 sites report using this module
- Created by shadcn on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
7.x-1.0
released 6 April 2013
Works with Drupal: 7.x
✓ Recommended by the project’s maintainer.
Development version: 7.x-1.x-dev updated 1 Apr 2013 at 13:39 UTC