I have a Primary links menu, and child menu items don't appear in the rendered HTML.
Here's an example of what's being rendered:
<div id="navigation">
<div class="section clearfix">
<ul id="main-menu" class="links clearfix">
<li class="menu-577 first">
<a title="" href="/platform">The Platform</a>
</li>
<li class="menu-1308">
<a title="2010 Directions" href="/2010-directions">2010 Directions</a>
</li>
<li class="menu-1268">
<a title="How to help" href="/how-help">How to help</a>
</li>
<li class="menu-1267 last">
<a title="Why do this?" href="/why-do">Why do this?</a>
</li>
</ul>
</div>
</div>The Platform menu item has two child items that aren't being rendered.
Seems like child items ought to be rendered?
Comments
Comment #1
aren cambre commentedBTW, I submitted this because other themes render child items in the primary menu.
Comment #2
jaxtheking commentedSame problem here... if I find out what it is, I'll let you know by tomorrow
Comment #3
johnalbinUnfortunately, Drupal's default primary links inside the page.tpl.php only has the first level of the main menu. That is by design. (A design I'm not too crazy about, btw.)
Its the frustration I had about the inflexibility of the page.tpl's primary and secondary links display that drove me to write the menu_block module. http://drupal.org/project/menu_block
If you need the child menu items to appear on your page, I recommend going into your sub-theme's settings (go to admin/build/themes and click the "configure" link next to your sub-theme) and turning off the display of the primary and secondary links. And then adding and configuring the menu_block module to your site.
If you need more information about how to set this up, feel free to re-open this issue.
Comment #4
aren cambre commentedThank you!
Has anyone made a feature request against Drupal core to fix this?
Comment #5
jaxtheking commentedThere you go, you have already the answer there. Great little module by the way.
I was not aware of WHY this limitation existed, it IS pretty annoying. Anyhow, there are other more immediate ways around this. I just put them here so you can let me know what you think.
1. Simply print the 'Primary Links' block in your page.tpl.php file (see module_invoke)
2. Create a new region in your template (navigation) and place the 'Primary Links' block in it. Drupal WILL render the menu children.
3. Uncomment the STARTERKIT_preprocess_page(&$vars, $hook) function and add the following variable:
// Generate menu tree from source of primary links
$vars['primary_links_tree'] = menu_tree(variable_get('menu_primary_links_source', 'primary-links'));
Then, in your page.tpl.php write the following code and you're done:
if ($primary_links):print $primary_links_tree;endif;Hope that helps. I haven't got time to go more in details, but if you have any other question, go ahead! The Zen theme is awesome btw
Comment #6
akalata commentedComment #8
live4speed commentedThank you SO MUCH for the menu_block module. I was pulling my hair out for 3 months trying to overcome a problem that menu_block solved in 5 minutes. See my post for specifics http://drupal.org/node/937114