Wednesday, November 23, 2011

Creating and Displaying Primary and Secondary Links

Creating and Displaying Primary and Secondary Links:
Create the Primary and Secondary links from the drupal admin end by,
Administer->Site Building->Menus->Primary Links or Secondary Links->Add item
There give the path that your primary that redirects to,next give title in the second field then give weight if u need.Then save it.Create more like this and print this in page.tpl.php or in your Header.php block using this code,

For Primary Links
<?php
 if (isset($primary_links)) {
 print theme('links', $primary_links, array('class' => 'links', 'id' => 'navlist'))
 } 
?> 
For Secondary Links
<?php
if (isset($secondary_links)) { 
print theme('links', $secondary_links, array('class' => 'links', 'id' => 'subnavlist'))
}
?>
 

No comments:

Post a Comment