[support] Custom menu theming

sander-martijn sander at sander-martijn.com
Wed Sep 19 13:25:10 UTC 2007


You'll want to look at the enclosing divs above that first - if you edit 
the classes for menu and leaf it will apply to all menus that use the 
menu and leaf classes. 

What you need to do beyond that depends really on what you want to do.  
For example I have one menu that just uses css, one menu that uses the 
nice_menus module which I then modified the css for, and one completely 
custom menu that's written in straight php in my template and looks like 
this:
$trail = _menu_get_active_trail();
$mid = $trail[1];
if($mid != 5){
$output .= theme('menu_item', $mid);
$output.= theme('menu_tree',$mid);
print('<ul class="leftnavmenu">');
print $output;
print('</ul>');

So there is no correct answer - it all depends on what exactly you're 
trying to do.

Vasileios Lourdas wrote:
> On Wednesday 19 September 2007 16:07:05 sander-martijn wrote:
>   
>> It depends on what styling you need to do.  You can do a lot with css
>> and should try that route first.  You can figure out which css to add or
>> alter by viewing source and seeing which classes and ids are being
>> used.  You likely only have to edit functions if the menu is showing the
>> wrong elements, for example if it is showing children that you don't
>> want shown.  If it's presnting the correct elements but in the wrong way
>> you can probably fix it with css.
>>     
>
> OK, thanks for your suggestions. Drupal renders the code like this:
>
> <ul class="menu">
> <li class="leaf"><a href="...">Schools</a></li>
> <li class="leaf"><a href="...">Parents</a></li>
> ...
> </ul>
>
> So, I have to edit the menu and leaf classes in css. However, if I want to go 
> further, how do I have access to the menu structure through PHP?
>   

-- 
------------------------------------------------------------------------

sander-martijn <mailto:sander at sander-martijn.com>
interface developer | architect
sander at sander-martijn.com <mailto:sander at sander-martijn.com>
www.sander-martijn.com <http://www.sander-martijn.com>

------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20070919/ee50b995/attachment.htm 


More information about the support mailing list