.on web development, Drupal, PHP, photography, and the like.

CSS

Horizontal Menus Spanning across the Page

Posted by root
08.20th.2008

Filed under:


First off, this only supports the primary menu items, and if you can avoid it, I highly recommend you to use ul/li selectors. In some wacky universe out there, spanning horizonal menus across your page is desired and achievable by formatting the array of links return by menu_primary_links() function.

Drupal template.php Menu Snippit

Posted by root
08.10th.2008

Filed under:

This Drupal PHP snippit generates first/last and active classes for a menu and its sub menu's. It's great for when you have a couple different kinds of menu layouts. For example, the primary links are a drop down menu with a coloured active state and the footer menu has vertical bars between list elements, but not at the end.

The snippit generates active states which follow through from top level menus as well as sub menu's, picking out the first and last links in each list.

Dropping Horizontal Menu's in Drupal 5.x

Posted by root
08.10th.2008

Filed under:

This horizontal drop down menu is lightweight and uses minimal javascript. What this doesn't do, is interpret the primary links as links in PHP. What this menu does use, instead, is use the built in Drupal link generation. By creating blocks and assigning the Primary Links to this block, the menu generated by Drupal takes shape.

First, create a region in page.tpl.php. In the example below, the region is named $primary_nav. This region name will also appear in the template.php file. The division tag 'primarynav' is the CSS construct that is used to style the menu's.

Syndicate content