[themes] Highlighting active leaf in book navigation.

Mark Hope mark at markhope.net
Fri Jun 29 08:29:54 UTC 2007


On 29 Jun 2007, at 08:09, Xamataca wrote:

> I think, if I'm understanding it well, that you can do that with css.
>
> Example: http://www.456bereastreet.com/archive/200501/ 
> turning_a_list_into_a_navigation_bar/
>
> The quid is at step 10. This is done with diferent "id" for each  
> <body> tag (you probably will have to code some php to change it  
> dinamically...).
> This example uses list but you can use it with whatever element.
>
> Greets (first post... back to lurk)
> Heitor Real

Hi Heitor,

This would work for the primary nav in Drupal 5, but other menus that  
output .leaf couldn't be selected without altering the html using php.

Primary Nav:
<li class="menu-1-2-2"><a href="/example" class="menu-1-2-2">example</ 
a></li>
<li class="menu-1-3-2"><a href="/example2"  
class="menu-1-3-2">example2</a></li>

Other:
<li class="leaf"><a href="/" class="active">example</a></li>
<li class="leaf"><a href="/">example</a></li>

A unique class or ID is needed.

The technique you refer to is useful, and I've used it before. It can  
be used to permanently highlight which section you are within on a  
site (on the primary nav), and combining this with styling the  
active .leaf (or child a) will allow you to highlight the  
subnavigation, also.

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/themes/attachments/20070629/b60564b7/attachment-0001.htm 


More information about the themes mailing list