I want to add a menu item that is under one of the existing menu items. A menu on the new page with all the children would be great but I am not sure how to show it.

I have Primary links at the top in the header but they're not the Primary Links block under Admin/Site Building/Blocks but rather a default menu that is always displayed.

logo---------- -----------------------------
-------------- Primary Links----------------
_______________________________________
child links?---- content ---------------------
-------------- -----------------------------
-------------- -----------------------------
-------------- -----------------------------
-------------- -----------------------------

Comments

shadcn’s picture

if you want to display children menu item when a menu in the primary link is active follow these steps:

1. Enable php filter in modules.
2. Add a new block. in the block body choose php as input
3. enter this code

<?php
$tree = menu_tree_page_data('primary-links'); //substitute your menu name for primary-links
foreach($tree as $key => $mi) {
if ($mi['link']['in_active_trail'] && $tree[$key]['below']) {
$menu = menu_tree_output($tree[$key]['below']);
}
}
print $menu;
?>

4. place the block in a region

Thanks

GPSJane’s picture

Thanks. It didn't work but I did discover that in Menus you can set the source for Secondary links as Primary links which then uses the children of Primary links.