[development] Using Admin Theme on Other Pages

Ben Wheeler bennybobw at gmail.com
Sat Dec 29 05:42:03 UTC 2007


Hi All,
I think this is fairly simple to do, but I couldn't find anything in
the forum/handbooks. I have a theme that's very specific and doesn't
work well for admin type situations, so I have an admin theme set up.
I'd like to use my admin theme on other pages, so in my custom module
hook_menu (taking a cue from system.module) i have:

function custom_menu($may_cache) {
  $items = array();
  if ($may_cache) {
     blah blah blah
  }
  else {
    if (arg(0) == 'webfm' OR arg(0) == 'user') {
      global $custom_theme;
      $custom_theme = variable_get('admin_theme', '0');
    }
  }
return $items;
}

Which doesn't work at all, although it does set the variable
$custom_theme quite nicely. I'm thinking I have to set this at another
time, but I don't know how the whole admin theme thing works. Any
suggestions?  Thanks.

-Ben


More information about the development mailing list