1

I want to show the admin menu toolbar only for admin pages. How can I do this in Drupal 7?

closed as too broad by kiamlaluno Dec 19 '17 at 17:05

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What did you try? What documentation page did you read? Is there anything you don't understand in the task you described? – kiamlaluno Jul 27 '17 at 21:12
3

You can do this by theme difference . As you know your admin theme is different then you can apply this line of code in your custom module.

 function custom_page_alter(&$page) {
 global $theme;
 if ($theme == 'bartik') {
  unset($page['page_top']['toolbar']);
  }
}

if you using Administration menu module Then try this code

function custom_page_alter(&$page) {
 global $theme;
 if ($theme == 'bartik') {
  unset($page['page_bottom']['admin_menu']);
 }
}

Thank you

1

You can use hook_page_alter()

function hook_page_alter(&$page) {
  unset($page['page_top']['toolbar']);
}

Another option is

Toolbar Visibility module.

Remove toolbar on selected theme.

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