Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In our web (http://www.fundacionalzheimur.org/formacion) we use the structure of the menu primary links, but we haven't found an automatic way of present, as in a book, the child nodes when displaying a menú node.
Our solution is including this php snippet in the node.tpl template, just before the content, in a div floating right:
.... <div class="itemtext">
<!-- Expanded Menu for navigation -->
<?php
$mid = menu_get_active_nontask_item();
$active = menu_get_item($mid);
// this is a top-level link in your primary links
if($active['pid'] == variable_get('menu_primary_menu', 0)){
$output.= theme('menu_tree',$mid);
print('<div id="menubox"><h2>navigate</h2>');
print $output;
print('</div>');
}
?>
<!-- end of menu -->
<?php print $content?>
</div> .....
The CSS would be:
#menubox {
display: block;
float:right;
width: 35%;
margin-left: 18px;
margin-bottom: 18px;
padding-bottom: 5px;
background: #fff url(images/Fondo_Logo_menu.jpg) no-repeat bottom right;
}
#menubox h2 {
background: #fff url(images/block-quote_left.gif) no-repeat top left;
color: #6A0D22;
padding: 7px 7px 7px 37px;
margin-bottom: 2px;
line-height: 0.6em;
}
Comments
See module submenutree
While surfing, I came across this (apparently) old page. If you have a Drupal 5.x site, you may be interested in submenutree.
Submenutree drupal 6
Also available for Drupal 6
In Drupal 6
I don't know if it's exceedingly complicate, but this is what worked for me to display inside a page just the children (and their childrens and so on) of the current menu item.
In Drupal 6
where your code be added
modifcation w/ third-level support
oh
and it be added in a custom function you call
What custom method?
You mentioned custom method. Would you be able to provide the entire flow (template.php, page.tpl.php)?
Thank you!
Menu block module
This very flexible module may also do the trick: http://drupal.org/project/menu_block
*****************************
South Africa Drupal Development
*****************************
Charles
Drupal development, Cape Town, South Africa