Need Horizontal menu showing current page children

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
Kristy
Forum Members
Forum Members
Posts: 20
Joined: Tue Jul 10, 2007 3:56 pm

Need Horizontal menu showing current page children

Post 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
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Need Horizontal menu showing current page children

Post 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
Kristy
Forum Members
Forum Members
Posts: 20
Joined: Tue Jul 10, 2007 3:56 pm

Re: Need Horizontal menu showing current page children

Post 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
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Need Horizontal menu showing current page children

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “Layout and Design (CSS & HTML)”