Page 1 of 1

Need Horizontal menu showing current page children

Posted: Fri Oct 12, 2007 1:16 pm
by Kristy
I need a horizontal menu that will only show up when the current page has children and display the child page links. I've searched all over the forum and wiki. I want it to work like the "Generic Sub Menu" but it looks like Ellnav was combined when menu manager was created. I also do not want these child pages to show up in the vertical expand menu.

here is the code in the template that I am using

Code: Select all

<div id="menu_horiz">{hierarchy}
{menu template='simplenav' start_element=$h_this collapse='2'}</div>
The hierarchy is the UDT described in the wiki for Generic Sub Menu

Code: Select all

# Name: hierarchy
global $gCms;
$pos = $gCms->variables['position'];
$base = explode('.', $pos);
$smarty->assign('h_toplevel', $base[0] * 1);
$smarty->assign('h_parent',   $base[ (count($base) > 1) ? count($base)-2 : 0 ] * 1);
$smarty->assign('h_this',     $base[count($base)-1] * 1);
So the menu shows up but does not display the child for that page and the child shows up in the vertical menu.
You can see what I'm talking about here
http://tuckness.com/index.php?page=henr ... s-tuckness

Any idea's?

Thanks for any help!!!

Kristy

Re: Need Horizontal menu showing current page children

Posted: Fri Oct 12, 2007 6:20 pm
by RonnyK
Kristy,

if you call {menu} twice, you can do what you want, or I misunderstood your problem.

Code: Select all

{menu template='simple_navigation.tpl' number_of_levels='1'}
{* NB! The <ul><li> below is only added because several default templates use the same menu stylesheet, 
to "force" the subnavigation to act as if it's the second level in a list *}
<ul><li>{menu template='simple_navigation.tpl' start_level='2' collapse='1'}</li></ul>
or whatever template you use.....

Ronny

Re: Need Horizontal menu showing current page children

Posted: Sat Oct 13, 2007 11:24 am
by Kristy
Hi Ronny,
Thank you for responding. I guess I'm not explaining myself very well. I was looking around this site and on the "How-to" pages they use the type of navigation I'm talking about http://wiki.cmsmadesimple.org/index.php/How_to the tabs that say "edit" and "history" at the top of the page are second level to that page only.

I looked at the source and it looks like it's hard coded instead of using a navagational menu. I guess I'll just have to do it that way.

If anyone has any other ideas I would greatly appreciate it!

Kristy

Re: Need Horizontal menu showing current page children

Posted: Sat Oct 13, 2007 2:37 pm
by calguy1000
Ronny's example there should work perfectly..... 2 menu calls, one for the top level, the other one that shows the children of the current page.  Then all you would have to do is layout and style them.