Hi,

I want to add 'You are here' to the the breadcrumbs.

Like so;

<?php if ($breadcrumb): ?>
		<div id="breadcrumb">You are here:<?php print $breadcrumb; ?></div>
	<?php endif; ?>

But no matter how and where I have put it the line insists on breaking.
How can I do this without this happening?

Thanks.

Comments

matt_harrold’s picture

The breadcrumb is wrapped in a div (which is going to line break).

You'll need to adjust your theme css. Wrap the whole thing in another div:

<?php if ($breadcrumb): ?>
<div id="breadcrumb_wrapper">You are here:<?php print $breadcrumb; ?></div>
<?php endif; ?>

then add this to your theme style.css file.

#breadcrumb{
display:inline;
}

looklively’s picture

Thanks Matt for the reply.

That doesn't seem to work tho.
When you say wrap the whole thing in another div ... you have simply changed the id of the div that was already there.
The css rule you have put uses the first id tho.

Sorry but I don't get it.

stoptime’s picture

Hi there,

What you can do here is override the built-in breadcrumb template. In your template's folder, there should be a file called template.php (and if there's not, you can safely create one). Place this function inside of it - you can tailor it further to suit your needs:

function phptemplate_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
    return '<div class="breadcrumb">You are here: ' .  $breadcrumb . '</div>';
  }
}

Then, in your page.tpl.php, all you need to do is:

<?php print $breadcrumb; ?>

(Note that if you already have a template.php file, look for an existing function called phptemplate_breadcrumb() - if there is one, just comment it out and replace with the above.)

Hope that helps!

looklively’s picture

That did the trick nicely.

A little minor tailoring to accommodate my template and job done.

Thanks both for the help.

saradimi’s picture

Hi,

I tried your method but it doesn't work.

Instead of :
You are here: home > Mypage > ...

I have :
You are here: Array

Have you got an idea ?

Thanks.

Anonymous’s picture

After trying both of these, I threw in some of my own code to the page.tpl.php file. I am not an advanced programmer, but it worked.
I made sure the following was in my page.tpl:

<?php if ($breadcrumb): ?>
          <div id="breadcrumb">You are here: <?php print $breadcrumb; ?>
          </div><!-- /breadcrumb -->
          <?php endif; ?>

And then I added the following into my style.css file for my theme:

#breadcrumb .breadcrumb {
  margin: 0;
  padding: 0;
  display:inline;
}

It works!

I am using the acquia marina theme on Drupal 6.10, and all you need to do is add "#breadcrumb " before ".breadcrumb" and add the "display:inline" to it.

defconjuan’s picture

i do the following to add a little emphasis to the last item in the breadcrumb. this underlines and makes the last breadcrumb a little darker than the rest.

	#breadcrumb .breadcrumb a {
		color: #999;
		}
	#breadcrumb .breadcrumb a:last-child {
		color: #666;
		text-decoration:underline;
		}
Anonymous’s picture

And then I added the following into my style.css file for my theme:

I apologize for just now seeing it, but make sure you add the css code to your local.css if you are using Acquia Marina theme. If you don't then when you update you will have to add it again. If you have another theme, then I would suggest doing the same setup, i.e. using a local.css as opposed to directly altering your style.css. If you have built your own theme, then you're just outside my "expertise", lol.