[support] How to theme a menu ?

Daniel Honrade mail at danielhonrade.com
Wed Sep 9 08:45:35 UTC 2009


first you must expose the menu tree: (put this in the template.php)

function devavrata_extreme_preprocess_page(&$vars) {
    // Generate menu tree from source of primary links
    $vars['primary_links_tree'] =
menu_tree(variable_get('menu_primary_links_source', 'primary-links'));
    }
}

this will expose all the menus and submenus like

ul
    li     /li
    li     /li
       ul
            li     /li
            li      /li
       /ul
/ul


then,
 you need to use the firebug of firefox to see the ids and class

all you need to do now is to create css definitions like

#primary ul.menu li {}     //first level
#primary ul.menu li  ul.menu li {}   //second level
#primary ul.menu li  ul.menu li  ul.menu li {}   //third level

I use inline-block for the first level, position: absolute for the second,
third levels


2009/9/9 Ramon Vilar Gavaldà <ramon.vilar at gmail.com>

> Hi Michel
> Can you attach or copy your theme function?
>
> Ramon
>
> --
> Ramon Vilar Gavaldà - http://ramonvilar.facil.cat -
> http://blog.facilitant.net
> Membre de FÀCIL - http://www.facil.cat
> Membre de l'esplai SESA - http://www.esplaisesa.org
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>



-- 
Daniel Honrade, Jr.

mobile:  +63 915 903 3561
alternate email:  danielhonrade at gmail.com
websites:  http://danielhonrade.com
               http://webtheming.com


When you signup for PayPal, you can start accepting credit card payments
instantly. As the world's number one online payment service, PayPal is the
fastest way to open your doors to over 150 million member accounts
worldwide. Best of all, it's completely free to sign up! To sign up or learn
more, click here: https://www.paypal.com/ph/mrb/pal=GE47NYP4D94XA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/support/attachments/20090909/10591899/attachment.htm>


More information about the support mailing list