Hi,

in Drupal 5 I used the following code to make a menu show on the page:
in page.tpl.php:

<?php
$menuhtml = theme_menu_tree(64);
print $menuhtml; ?>

Now I tried to upgrade to 6.4 and I cant find the ID of the menu. All I can see is the number 64 printed on the page.

In the zen theme page.tpl.php I found this code:

 <?php if ($primary_links): ?>
            <div id="primary">
              <?php print theme('links', $primary_links); ?>
            </div> <!-- /#primary -->
          <?php endif; ?>

How do I use this code for my own menus. Why don't the menus have any IDs? At least I can't find them. In the admin in Drupal 5 I could hover over a link to edit the menu and the ID would show up.
How do I make my own menus appear on the site?

Thanks
cat

Comments

mrtoner’s picture

http://api.drupal.org shows that theme_menu_tree() has changed. It no longer expects the parent ID of the menu. I can't explain how to give it what it needs, but you might poke around there.

cattalk’s picture

Thanks for your hint!
I looked at the api and I know that the function needs the name of a menu. But if I use the function the way I think it should be used nothing shows up.

I noticed that if I have a menu called "test" and I mouse over the link to edit this menu in the admin the link shows that menu name to be http://mysite.com/?q=admin/build/menu-customize/menu-test.
The drupal menus don't have "menu-" in front of their name. They're just called "navigation" or
http://mysite.com/?q=admin/build/menu-customize/primary-links

Its still beyond me how I put a custom menu on the page.
I can assign a menu to act as primary and secondary links and I can output that, but what if I have a third navigation?

So this works:

<?php if ($primary_links): ?>
      <div id="primary">
        <?php print theme('links', $primary_links); ?>
      </div> <!-- /#primary -->
    <?php endif; ?>	

but this doesn't:

<?php if ($test): ?>
      <div id="primary">
        <?php print theme('links', $test); ?>
      </div> <!-- /#primary -->
    <?php endif; ?>	

regards
cat

-Anti-’s picture

> Its still beyond me how I put a custom menu on the page.

I've no idea about hard-coding a custom menu into a page, but
I thought the way custom menus are supposed to be added was
to place them inside a block (which itself resides in a template 'region')?