There's a light blue bar near the top of the content in the theme Garland and I'd like to know if it's possible to put links to other pages there. It's the bar that can be seen in the screenshot of this site: http://buytaert.net/garland and says Home > Administer > Site Building.

Comments

crookednumber’s picture

You can, but it would take some work -- as that section is (essentially) hard-coded for your breadcrumbs . You'd need to fork the Garland theme, possibly put a region there (if you want to be able to swap out menus via the admin screen), and tweak the CSS a bit. (Also, if you want to keep using breadcrumbs, you'd need to find an alternate location for them.)

awesomeasapossum’s picture

Okay, I'm a total n00b when it comes to PHP and CSS, so I looked at some other stuff and found out how to remove it. Then I added in a link using the echo command. This is what my code looks like

echo"<a href='http://www.yourlink.com' target='_blank'>Your Link</a>";
print $content

However, instead of appearing in the clear bar, it shows up lower than the bar. Do you know how I could reposition it to be in the bar?

crookednumber’s picture

The following is the quickest way. But it is NOT a long-term solution (to start, these changes will likely disappear when you upgrade drupal). Here you go.

Open the file page.tpl.php located in /themes/garland/

Find the line (~64):

<?php if ($breadcrumb): print $breadcrumb; endif; ?>

and replace it with:

<div class="breadcrumb"><?php echo "<a href='http://www.yourlink.com' target='_blank'>Your Link</a>"; ?></div>

This worked for me on a local site. (Though, again, this isn't a best-practice, long-term solution.)

crookednumber’s picture

It doesn't take more than a few seconds to copy the entire garland directory to /sites/all/themes/garland_dev (for example)

From there, you can start making as many changes as you want (including the one outlined above) to the new theme. Go nuts!

[And this is definitely a better practice.]

awesomeasapossum’s picture

Thanks for your help! I have a question though. Is there a way to make what shows up in the bar editable like a normal menu?

crookednumber’s picture

That goes back to what I mentioned earlier -- about creating a region and then inserting a menu in that region.

Start here (assuming you're on Drupal 5):

http://drupal.org/node/29139

awesomeasapossum’s picture

Okay, thanks for that link. Also ONE more thing (I promise!). How would I change the position if I wanted to add multiple items to the breadcrumb bar.

crookednumber’s picture

You mean change the height of that bar? It's not easy. You'd have to go in and play with the CSS --- while avoiding unintended consequences. (Assuming I got your question right.)

awesomeasapossum’s picture

Sorry for not explaining that well enough first time around. Right now it has one link: "Home". However, how would I go about adding other links such as "Contact" and "About".

Also, when I click on the link, it opens in a new window--how would I change this?

Thank you soooo much for all your help.

crookednumber’s picture

Well the breadcrumb isn't a menu, per se. It's a list of links that changes based on where you are in the site. So you can't "choose" which links to put up there. They are pre-determined by which page you're on.

As for the new window thing -- it's unlikely that's that Drupal doing that (esp. if you're using a standard theme). I'm guessing it's a browser setting (?).

awesomeasapossum’s picture

I've checked, it isn't the browser.

And so you're saying that I can only have one link on there using that code you gave me? There's no way to add other links? Even in the page.tpl?

crookednumber’s picture

The new window issue: if you're using a standard theme (like Garland), then it's not Drupal. What does the HTML for those links say?

Yeah, you can add those links. Just like I was explaining here - http://drupal.org/node/250388#comment-820169. You need to create a menu, tweak the theme, and add a region.