By john.kenney on
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
&& arg(0) == 'admin'
&& arg(0) == 'admin'...
beauty!!
that does it. thank you very much!
So the whole thing is: <?php
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! ^^
Ah... Actually, you don't
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; ?>Drupal 7 breadcrumbs for admin only
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