[development] Highlighted tabs, primary links, and bread crumbs

Nic Ivy nji at njivy.org
Tue Mar 28 20:29:27 UTC 2006


I'm working on a new site for which I am using primary links (i.e.  
menu items) as tabs across the top of each page to describe different  
areas.  It would be nice if I could visually segregate content into  
the different areas by highlighting the correct tab.

i have several thousand pieces of content, and the number is  
growing.  If I simply defined menu items for each node, I expect  
performance would diminish as the size of $menu increased.

Other people have tried to accomplish this highlighting trick using  
hacks and kludges (e.g. http://drupal.org/node/46020).  I have done  
the same until now.  But for some reason, PHP in page.tpl.php does  
not have access to the current page's query string or bread crumbs.   
This seems to be a recent change in HEAD.

So, to determine which tab to activate, I am comparing in  
page.tpl.php the supplied bread crumb links with the supplied primary  
links.  When there is a match, I activate the primary link so the tab  
looks highlighted.

But how can I define arbitrary bread crumbs for a large number of nodes?

Is there a better way to do this?  Has anyone else done this?

Nic


More information about the development mailing list