Posted by niels on December 3, 2010 at 8:57pm
I am fishing for thoughts on how to create a consistent header on every page of a Drupal 6 site in order to be compliant with the UM Web Standards - similar to what is at the top of the FireCenter page. Would this best be accomplished with a php snipit or 3rd party module? Any advice would be much appreciated.
Thanks so much,
Niels

Comments
page.tpl.php
Neils,
Typically this would be done with a simple edit to the page.tpl.php file in your theme. By editing that file, you can affect the html output of all of the pages on your site. You may add something in the appropriate area of your page.tpl.php file:
<div id="umheader"><div id="umnavcontainer">
<ul id="umnavlist">
<li><a href="http://www.cfc.umt.edu/" target="_blank" title="College of Forestry and Conservation">CFC HOME</a></li>
<li id="active"><a href="http://www.umt.edu" target="_blank" title="UM HOME">UM HOME</a></li>
<li><a href="http://www.umt.edu/Search/AtoZ/" target="_blank" title="A-Z INDEX">A-Z INDEX</a></li>
<li class="last"><a href="http://www.umt.edu/Search/" target="_blank" title="SEARCH UM">SEARCH UM</a></li>
</ul>
</div>
</div>
If you need help figuring out where to place this in your template file, let me know, and I'll be happy to help.
Best,
Scott
Scott Rouse
http://about.me/scott.rouse
CSS
You'd obviously have to style that with CSS to make it look the way you want. You can steal some of the CSS from the Fire Center site. The HTML above is straight from that site's source code.
Again, happy to help more, if needed.
-Scott
PS - As Christopher has repeatedly discovered, I'm sure there is "a module for that," but a task such as a consistent site header is best accomplished by editing your theme's template file. (Not nearly as intimidating as it sounds.)
Scott Rouse
http://about.me/scott.rouse
Sucess!
Found it. Thanks so much Scott.
Good
Glad to hear.
Scott Rouse
http://about.me/scott.rouse
GROAN!
What have I started? :-D Yes I am sure there is a module for that but even I the 'Module Monster' have learned enough editing to go after templates for main and nodes. Albeit, not very well yet. Keep in mind folks that I am super new to all of this web stuff so I tend to go the lazy way and lean heavily on modules. Thanks to Scott's and Andy's coaching I am now timidly venturing into playing with some of the basic code.
Since I am not code blessed as others (yet) I love that modules do the heavy lifting but realize I may have gone too far in the Module smorgasbord. Working on it though!
Scott is spot on by saying that anything that is to stay consistent (as much as anything 'stays' on a site) is best 'edited in' verses a module. My site (roughed in) will benefit by HTML and CSS to help reduce serving and delivery load. 'Web green' and 'HTML tidy' is the way to go.
Yes, there is no shame in 'stealing' CSS and I have heard that in more than one place. The trick of it is knowing what CSS affects what and how and how one implements it. Luckily for me and I am sure many others, Firefox Firebug (add on)to the rescue! Awesome tool for finding almost any code on any website and how it is implemented-as in the CSS name (which you could change) and the DIV name that corresponds. Easy to use once one gets the simple hang of it and then just copy paste or follow that site's CSS trail and then copy/paste.
BUT I am sure you knew that already. ;-D
Sometimes you want a user/client to be able to modify...
those "consistent" headers, so I tend to make custom blocks and regions to do this kind of stuff. That way, if you're dealing with multiple themes per site (and using something like the Theme Key module), you don't have to do a lot of work adding lots of code: you simply need to ensure that your block regions are consistent. You don't have to train your site editors how to deal with template files, and you can do the custom UI work through Drupal rather than through interacting directly with your theme template files.
You can also set it up so that blocks are simply php statements calling out specific nodes that have your header code in them. That way you can create custom admin sections of your sites for site editors that let them edit "header" nodes instead of poking around the blocks configuration stuff (and potentially making some interesting mistakes).
Great point
Thanks for dropping by our group!
Yes, this is a common use case, where the client wants to be able to modify headers/footers. Using custom HTML blocks is supported in Drupal core, but for that to work you need to grant the 'administer blocks' permission to the client, which can get messy – if they're not careful they can really mess up your site! The way I like to do it is using the Boxes module along with Context module. Boxes is a simple replacement for core custom blocks, and using Context you can easily add them to any region.
With Boxes I get three wins:
* Don't need to grant 'Administer blocks' permission to clients.
* Boxes have an 'edit' link right on the box when user is logged in with correct permissions, so they don't need to go hunting in the admin section to find where to edit the box. (Some themes support this for core custom blocks as well, but with boxes it works everywhere.)
* Boxes module is set up to work with Features module, so Box configurations are exportable to code (important for my workflow.)
– Andy