In need of menu template assistance

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"
Locked
fisherbt

In need of menu template assistance

Post by fisherbt »

Hello.  I have a site - http://www.speedlinemedia.com that has pages laid out like this:

1. Home
2. Services
  2.1 Cable TV
  2.2 High Speed Internet
  2.3 Digital Phone
  2.4 Wi-Fi Access
3. Support
  3.1 Cable TV Self Help
  3.2 Internet Security Center
4. About Speedline
  4.1 History
5. Property Owners
  5.1 Benefits
  5.2 Services

I'm trying to create a menu that will be displayed on top-level pages as well as all of the child pages of those top-level pages. Basically the parent's child pages should be accessible on any of that parent' child page as well as parent page itself.

For example, when a user lands on "Property Owners", links to "Benefits" and "Services" should be displayed.  Similarly when the user lands on "Benefits"  links to "Benefits" and "Services" need to be displayed.

I've got the links displaying correctly on the top-level pages, but they are not displayed on child pages.

Here's the template I'm using:

Code: Select all

{assign var="depth" value="-2"}
{assign var="depthcheck" value="0"}
{if $count > 0}
{foreach from=$nodelist item=node}
{if $depthcheck == 1 && $node->depth != $node->prevdepth}
<ul>
{assign var="depth" value=$node->depth}
{assign var="depthcheck" value="0"}
{assign var="listopened" value="1"}
{/if}
{if $node->depth == $depth}
<li>
<a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}</a></li>
{/if}
{if $node->current == true &&  $node->haschildren == true}
{assign var="depthcheck" value="1"}
{/if}
{/foreach}
{if $listopened == 1}
</ul>
{/if}
{/if}
I'm stumped. I'm new to building menus, so it's likely an easy solution.  Thank you very much for any and all help.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: In need of menu template assistance

Post by Dr.CSS »

(optional) start_level="2" - This option will have the menu only display items starting a the given level. An easy example would be if you had one menu on the page with number_of_levels='1'. Then as a second menu, you have start_level='2'. Now, your second menu will show items based on what is selected in the first menu.

Read below \/...
Locked

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