I have this line in my page.tpl.php file. It shows breadcrumb when admin logged in.

<?php if ($user->name == admin && $breadcrumb): ?><?php print $breadcrumb; ?><?php endif; ?>

How can I tweak this to show breadcrumb when admin logged in AND /admin/* pages are showing? So I need another conditional element, but I don't know the proper variables or values to use.

Goal is to show the breadcrumb for me/admin and only when I am on back end of site. When I'm on front, I don't want any breadcrumbs.

Thank you for any assistance!

Comments

zbricoleur’s picture

&& arg(0) == 'admin'

john.kenney’s picture

beauty!!

that does it. thank you very much!

lolmaus’s picture

So the whole thing is:

<?php if ($user->name == admin && $breadcrumb && arg(0) == 'admin'): ?><?php print theme('grid_block', $breadcrumb, 'breadcrumbs'); ?><?php endif; ?>

Thank you! ^^

lolmaus’s picture

Ah... Actually, you don't need the user 1 limitation, as long as you show the breadcrumb within /admin/ section.

So the whole thing will be:

<?php if ( $breadcrumb && arg(0) == 'admin'): ?><?php print theme('grid_block', $breadcrumb, 'breadcrumbs'); ?><?php endif; ?>

This one is for Fusion base theme. For a generic theme it'll look like this:

<?php if ( $breadcrumb && arg(0) == 'admin'): ?><?php print $breadcrumb; ?><?php endif; ?>

ataxia’s picture

I know this topic was initially for Drupal 6, but I had to look all over to find this info for Drupal 7 and finally figured it out. No customization necessary!

Set a different theme for administrators only at the bottom of the admin/appearance page (I used the "Seven" theme) - be sure the theme is enabled.

Then, even if you have disabled the breadcrumbs for your default theme, you can leave them set for the admin theme.

Drupal 7....some things are good, some are not so good (yet.)

- ataxia