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}