2

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

  • 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

| improve this answer | |
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.

| improve this answer | |

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