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

Drupal 5.x

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.

Arguing with Drupal

Posted by root
08.10th.2008

Filed under:

When taxonomy based theming in Drupal becomes cumbersome or its just not enough, theming based on arguments just might do the trick! Recently I had to setup a theme without setting up a site and parts of the site had different themes. Since I had no knowledge of any taxonomy, customizing page layouts via path arguments became a reality (and quite powerful!)

The use of extracting arguments in Drupal is a very powerful thing. Once you break down the Drupal path, you can customize practically everything. The path is the part after ?q= or /drupal_installation/.

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.

Custom Login Pages & Forms

Posted by root
08.7th.2008

Filed under:

Let's revisit Drupal arguments to extend page layouts for our newly customized login/registration form. Assuming the login page you want is different than the rest, say a one column layout with custom blocks that are not found on any other page. If you just want the custom login forms, skip step 1.

Step 1 - Setting up custom pages

The following snippit will cover the following arguments:

Syndicate content