I've found the following snippet which shows the primary links in a block:

<?php

$output = theme('dhtml_menu_tree', variable_get('menu_primary_menu',0), array('class'=>'dhtml_menu menu-root'));

return $output;

?>

I have zero php skills, and am hoping someone can help me figure out how to show only the lower level items. For example, the entire menu looks like:

A
-- A1
-- A2
-- A3
------ A3i
------ A3ii
B
C
-- C1
-- C2
------ C2i
------ C2ii
------ C2ii
D

The regular, horizontal primary menu displays the top two levels. I'd like to have a block that shows the sub-level menu tree.

Comments

marcvangend’s picture

There are a couple of modules that can help you, for instance menu_trim. http://drupal.org/project/menu_trim

kulfi’s picture

That module does exactly what I was looking for.

arh1’s picture

for reference, note that there are many ways to do this at the theme level, too. (it may be preferable to not add an additional module/dependency for this type of thing...)

here are a couple of pointers for relevant functions that i've come across (check out the API site for more info):

// print the secondary links based on the active trail of the current url
print theme('menu_links', menu_secondary_links()); 

// print the menu tree for a given parent menu id (in this case, 97)
print theme_menu_tree('97');

and here are a couple of related discussions i've participated in recently:

http://drupal.org/node/241361
http://drupal.org/node/230307

kulfi’s picture

I think you misread the question, it isn't related to the other threads - but http://drupal.org/project/menu_trim was a perfect fit.