Return to Snippet

Revision: 11415
at February 4, 2009 13:24 by zachharkey


Updated Code
<?php
/**
 * Option 1
 *******************************************************/ ?>

  <?php if (isset($primary_links)) : ?>
    <?php print theme('links', $primary_links, array('class' => 'links primary-links clear-block')) ?>
  <?php endif; ?>

  <?php if (isset($secondary_links)) : ?>
    <?php print theme('links', $secondary_links, array('class' => 'links secondary-links clear-block')) ?>
  <?php endif; ?>


<?php
/**
 * Option 2
 *******************************************************/ ?>

  <?php if (isset($primary_links)) { ?>
    <div id="primary-links">
      <?php print theme('menu_tree',variable_get('menu_primary_menu',0)); ?>
    </div>
  <?php } ?>


<?php
/**
 * Option 3
 *******************************************************/ ?>

  <?php if (isset($primary_links)) {
      print theme('links', $primary_links, array('class' => 'links primary-links clear-block'));
    } ?>

Revision: 11414
at February 4, 2009 13:21 by zachharkey


Updated Code
<?php
/**
 * Option 1
 *******************************************************/ ?>

              <?php if (isset($primary_links)) : ?>
                <?php print theme('links', $primary_links, array('class' => 'links primary-links clear-block')) ?>
              <?php endif; ?>
              <?php if (isset($secondary_links)) : ?>
                <?php print theme('links', $secondary_links, array('class' => 'links secondary-links clear-block')) ?>
              <?php endif; ?>


<?php
/**
 * Option 2
 *******************************************************/ ?>
              <?php if (isset($primary_links)) { ?>
                <div id="primary-links">
                  <?php print theme('menu_tree',variable_get('menu_primary_menu',0)); ?>
                </div>
              <?php } ?>


<?php
/**
 * Option 3
 *******************************************************/ ?>

              <?php if (isset($primary_links)) {
                  print theme('links', $primary_links, array('class' => 'links primary-links clear-block'));
                } ?>

Revision: 11413
at February 4, 2009 12:01 by zachharkey


Initial Code
<?php
/**
 * Option 1
 *******************************************************/ ?>

              <?php if (isset($primary_links)) : ?>
                <?php print theme('links', $primary_links, array('class' => 'links primary-links clear-block')) ?>
              <?php endif; ?>
              <?php if (isset($secondary_links)) : ?>
                <?php print theme('links', $secondary_links, array('class' => 'links secondary-links clear-block')) ?>
              <?php endif; ?>


<?php
/**
 * Option 2
 *******************************************************/ ?>
              <?php if (isset($primary_links)) { ?>
                <div id="primary-links">
                  <?php print theme('menu_tree',variable_get('menu_primary_menu',0)); ?>
                </div>
              <?php } ?>


<?php
/**
 * Option 3
 *******************************************************/ ?>

              <?php if (isset($primary_links)) {
                  print theme('links', $primary_links, array('class' => 'links primary-links clear-block'));
                } ?>

Initial URL

                                

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

Initial Title
Drupal primary links

Initial Tags
textmate, drupal, theme

Initial Language
PHP