/ Published in: PHP
This code is ideal for situations where you have expandable primary links that don't particularly need their own page, but you would like to have links to the child menu items for users that do not have javascript enabled, or so on...
Expand |
Embed | Plain Text
<?php function find_plink_item($tree, $search_path){ foreach($tree as $plink){ if($plink['link']['link_path'] == $search_path){ return $plink; } $subsearch = find_plink_item($plink['below'], $search_path); if($subsearch){ return $subsearch; } } } return NULL; } $my_plink = find_plink_item(menu_tree_page_data('primary-links'), 'node/'.arg(1)); if($my_plink){ foreach($my_plink['below'] as $child_plink){ } } } ?>
You need to login to post a comment.
