Thursday, 3 March 2011

Theming Menus

  1. Navigate to Administer, Site building, Menus.
  2. Choose the Settings tab.
  3. Change the “Source for the secondary links” so that it matches the menu that is set in the “Source for the primary links.”
  4. Scroll to the bottom of the Web page and click “Save configuration.”
The page template variable $secondary_links now contains the subsection links that have been defined for each of the items in $primary_links. Referring to the previous example, “Kitten” will now be displayed in the output of $secondary_links when you select “Mammal” from the list of menu options provided by the variable $primary_links.
 
 
function blog_preprocess_page(&$variables) {
// Make a shortcut for the primary links variables
$primary_links = $variables['primary_links'];


// Loop through the menu, adding a new class for CSS selections
$i = 1;


foreach ($primary_links as $link => $attributes) {
  // Append the new class to existing classes for each menu item
  $class = $attributes['attributes']['class'] . " item-$i";


  // Add revised classes back to the primary links temp variable
  $primary_links[$link]['attributes']['class'] = $class;
  $i++;
}
 // End of the foreach loop


// reset the variable to contain the new markup
$variables['primary_links'] = $primary_links;


} // End of the preprocess function
 
get help from http://www.informit.com/articles/article.aspx?p=1336146&seqNum=3 

1 comment:

  1. nice blog and the selection procedure of the blog is better than others. you can visit my blog as well-- http://furniturestoresbedroom.blogspot.com/
    http://technologyforeducationlatest.blogspot.com/

    ReplyDelete

Source base installation of php, mysql and apache in ubuntu/ linux

Compile and Install a LAMP(Linux/Apache/MySQL/PHP) Server from Source In the last post, I described the method to install a LAMP ser...