How do I create another menu variable, with the user menu in it, and display it like the main and secondary menus?

I am already using the main and secondary menus, and need a third.

So:

      <?php if ($main_menu_links): ?>
      <div id="main-menu-wrapper" class="clearfix">
        <div class="main-menu-inner"><?php print $main_menu_links; ?></div>
      </div>
    <?php endif; ?>

Becomes:

    <?php if ($user_menu_links): ?>
      <div id="user-menu-wrapper" class="clearfix">
        <div class="user-menu-inner"><?php print $user_menu_links; ?></div>
      </div>
    <?php endif; ?>

Thanks

Glenn

Comments

glennnz’s picture

I have, in my template.php:

<?php
function vicus_preprocess_page(&$vars) {
  $vars['secondary_user'] = menu_navigation_links('user-menu');
}
?>

and

<?php print $secondary_user; ?>

in my page.tpl.php, but I'm getting:

Notice: Undefined variable: secondary_user in include() (line 124 of /Volumes/Webserver/sites/vicus/sites/all/themes/vicus/templates/page.tpl.php).

Even if I use:

<?php
function vicus_preprocess_page(&$vars) {
  $vars['secondary_user'] = 'some random text';
}
?>

I get the same error.

What am I doing wrong?

Thanks

Glenn

glennnz’s picture

Status: Active » Closed (fixed)

Solved

<?php
function mytheme_preprocess_page(&$vars) {
  $vars['secondary_user'] = theme('links', array('links' => menu_navigation_links('user-menu')));
}
?>