Garland-Use the light blue bar above content for a menu?
awesomeasapossum - April 23, 2008 - 20:03
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.

Definitely Possible
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.)
Here's what I tried.
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
<?phpecho"<a href='http://www.yourlink.com' target='_blank'>Your Link</a>";
?>
<?phpprint $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?
Quickest way
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.)
p.s.
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.]
Thanks, one more question?
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?
yes
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
Thanks
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.
Not sure I understand
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.)
Not totally correct: Rephrased and one final question
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.
OK
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 (?).
not my browser
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?
The new window issue: if
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.