Return to Snippet

Revision: 28775
at July 14, 2010 06:46 by jonathanpglick


Initial Code
$match = preg_match('/(user$)|(user\/)/', $_SERVER['REQUEST_URI']);
if ($match) {
    global $conf;
    $conf['theme_default'] = variable_get('admin_theme', '{admin-theme-name}');
}

Initial URL

                                

Initial Description
This example triggers the admin theme when on any of the user/* pages (login, edit, etc.).  Put the name of your admin theme in {admin-theme-name} so there's a safe fallback in case variable_get doesn't find the admin_theme.

Initial Title
Drupal - Programatically trigger another theme

Initial Tags
drupal

Initial Language
PHP