I remember something a long time teacher said, "Nick, if you make a suit out of a gorrilla, the arms are too long." I forgot why that was relevent to the topic of theming menu trees.
Moving on, here's a nice little function I wrote to return a themed menu tree by path.
<?php
// will return all menu items under "administration".
print theme('menu_tree_by_path','admin');
// will return links to all node submission forms
print theme('menu_tree_by_path','node/add');
// return the correct menu array by path
function menu_get_mid_by_path($path) {
// oddly, menu_get_item accepts a path, but returns the parent id.
As you can see, these menu links have unique icons. Yet another miracle accomplished using Drupal's PHPTemplate. This technique is especially cool because it automatically generates CSS ID's from the menu link's name.
<?phpfunction phptemplate_menu_item($mid, $children = '', $leaf = TRUE) { return _phptemplate_callback('menu_item', array( 'leaf' => $leaf, 'mid' => $mid, 'children' => $children ));}?>
Now create a menu_item.tpl.php file.
Recent comments
39 sec ago
3 days 14 min ago
1 week 1 day ago
1 week 2 days ago
1 week 2 days ago
1 week 5 days ago
1 week 6 days ago
1 week 6 days ago
1 week 6 days ago
3 weeks 2 days ago