Posted By

zachharkey on 02/04/09


Tagged

textmate drupal theme page-tpl-php


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

troynt
jmiller
variantstudios


Drupal primary links


 / Published in: PHP
 

Few different ways to output primary links in your page.tpl.php template.

  1. <?php
  2. /**
  3.  * Option 1
  4.  *******************************************************/ ?>
  5.  
  6. <?php if (isset($primary_links)) : ?>
  7. <?php print theme('links', $primary_links, array('class' => 'links primary-links clear-block')) ?>
  8. <?php endif; ?>
  9.  
  10. <?php if (isset($secondary_links)) : ?>
  11. <?php print theme('links', $secondary_links, array('class' => 'links secondary-links clear-block')) ?>
  12. <?php endif; ?>
  13.  
  14.  
  15. <?php
  16. /**
  17.  * Option 2
  18.  *******************************************************/ ?>
  19.  
  20. <?php if (isset($primary_links)) { ?>
  21. <div id="primary-links">
  22. <?php print theme('menu_tree',variable_get('menu_primary_menu',0)); ?>
  23. </div>
  24. <?php } ?>
  25.  
  26.  
  27. <?php
  28. /**
  29.  * Option 3
  30.  *******************************************************/ ?>
  31.  
  32. <?php if (isset($primary_links)) {
  33. print theme('links', $primary_links, array('class' => 'links primary-links clear-block'));
  34. } ?>

Report this snippet  

You need to login to post a comment.