1

I have two active theme, and switching between them by themekey on specific paths.

theme #one is my main theme, and some contents load in theme #two in a modal box (lightbox2). I need disable Toolbar on theme #two because it's load Toolbar too and I don't want it there.

my question is how can I disable Toolbar in theme #two?

1

You'll have to use hook_page_alter from within a module to unset $page['page_top']['toolbar'] — you can't do it from within a theme.

There is a module for that: Toolbar Visibility.

  • There are only 10 sites using that module, so beware. Read the code. – Capi Etheriel Jun 12 '12 at 19:04
-1

Or you can disable the 'toolbar' module for this.

https://www.ostraining.com/blog/drupal/adding-the-administration-menu-to-drupal-7-and-disabling-the-default-toolbar/

Is it the best way you think? Or plan something like,

 1.
      if ($vars['page']['page_top']['toolbar']['#access']) {   
         $vars['page']['page_top']['toolbar']['#access'] = false;
      }

But I don't know where could you find the '$vars' from.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.