Drupal 6 - output your primary links as a Site Map

Oct 06, 2008

This took me a while to find: In Drupal 6, I wanted to output the main Primary Links menu item, expanded, as a site map: Simply add the following to a node (with PHP parsing ON!)

<?php
$tree = menu_tree_all_data($menu_name = 'primary-links', $item = NULL);
print menu_tree_output($tree);
?>

Comments

flevour

flevour wrote on 12/23/08 1:35 AM

The code you may actually want is this (those PHP between parenthesis is quite wrong, even if it works):
&lt;?php
$tree = menu_tree_all_data(''primary-links');
print menu_tree_output($tree);
?&gt;
Thanks for sharing,
Francesco
Tom k

Tom k wrote on 12/23/08 2:05 AM

Many thanks: still getting used to both PHP &amp; drupal!

Write your comment



(it will not be displayed)