Hi the drupal community,
I am a newbie in the community, i hope someone may help.
I build a new theme for my web site.
I tried to implement a menu with sub menus. But even if the sub menus are defined as "expanded", they don't appear at all.

following the html code on my site:

<div id="menu">
	  <div id="primary">
		<ul class="links">
                    <li class="menu-121 first"><a href="/AboutUs">About us</a>
                   </li>
                    <li class="menu-491 last"><a href="/node/10" title="Solutions">Solutions</a>
                   </li>
                 </ul>
	  </div> <!-- /#primary -->
    </div>

on the page.tpl.php, the menu is as following:

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

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

When i use another theme, everything is fine...
someone know what to do?
I try to search the net about submenu and jquery but nothing works...

Comments

ask4prasath’s picture

your theme Doesnt Have the javascript for the drop Down
Try nicemenus module. this will definitely help you

Cheers

ask4prasath@gmail.com

ephy’s picture

thank you for your response...
It will be cool for me to understannd why it doesn't work !
I prefer to fix the bug instead of using a patch (nicemenus...)..

10x

ephy’s picture

no news?

ask4prasath’s picture

Cheers for Drupal

Prasath

varunity’s picture

I was struggling with the same problem. I found that the links were working fine when the Garland theme is enabled so I know it was a problem with my theme. Sure enough, after examining page.tpl.php I found the following lines:

    <?php if ($primary_links) : ?>
     <?php print theme('links', array_reverse($primary_links), array('class' =>'links', 'id' => 'primary')); ?>
    <?php elseif ($secondary_links) : ?>
     <?php print theme('links', $primary_links, array('class' =>'links', 'id' => 'secondary')); ?>
    <?php endif; ?>

So I removed the elseif and changed the 4th line to say $secondary_links instead of $primary_links. Clearly the theme I'm using (spreadfirefox) wasn't developed to handle secondary links. By making changes to the above, the secondary links then worked perfectly.

   <?php if ($primary_links) : ?>
     <?php print theme('links', array_reverse($primary_links), array('class' =>'links', 'id' => 'primary')); ?>
    <?php endif; ?>
    <?php if ($secondary_links) : ?>
     <?php print theme('links', $secondary_links, array('class' =>'links', 'id' => 'secondary')); ?>
    <?php endif; ?>
varunity’s picture

is secondary links enabled on admin/build/themes/settings? This is what the theme is looking for with the if ($secondary_links) statement

sakib000’s picture

This is your solution:

<?php if (isset($primary_links)) : ?>
<div id="primary_menu">
		<?php print menu_tree($menu_name = 'primary-links'); ?>
</div>
<?php endif; ?>
garbo’s picture

Don't forget to use the render function!

print render(menu_tree($menu_name = 'primary-links'));