[solved] MenuManager {if $node->hierarchy > 2.8}
Posted: Tue Apr 27, 2010 7:37 am
Anyone knows why menumanager doesn't support this argument {if $node->hierarchy > 2.8} if items hierarchy higher than 2.9? It won't display menu items.
Content management as it is meant to be
https://forum.cmsmadesimple.org/
Code: Select all
{if $count > 0}
<div class="foot_nav">
<ul>
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{if $node->hierarchy|version_compare:'2.1':'>=' && $node->hierarchy|version_compare:'2.4':'<'}
{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
<li><h2><a class="active" href="{$node->url}">{$node->menutext}</a></h2>
{elseif $node->current == true and $node->depth == '1'}
<li><h2><a href="{$node->url}">{$node->menutext}</a></h2>
{elseif $node->haschildren == true}
<li><h2><a class="menuparent" href="{$node->url}">{$node->menutext}</a></h2>
{elseif $node->type == 'sectionheader'}
<li class="sectionheader"><span> {$node->menutext} </span>
{elseif $node->type == 'separator'}
<li class="seperator">
{elseif $node->depth == '1'}
<li><h2><a href="{$node->url}">{$node->menutext}</a></h2>
{else}
<li><a href="{$node->url}">{$node->menutext}</a>
{/if}
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}
</li></ul></div>
<div class="foot_nav">
<ul>
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{if $node->hierarchy|version_compare:'2.4':'>=' && $node->hierarchy|version_compare:'2.7':'<'}
{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
<li><h2><a class="active" href="{$node->url}">{$node->menutext}</a></h2>
{elseif $node->current == true and $node->depth == '1'}
<li><h2><a href="{$node->url}">{$node->menutext}</a></h2>
{elseif $node->haschildren == true}
<li><h2><a class="menuparent" href="{$node->url}">{$node->menutext}</a></h2>
{elseif $node->type == 'sectionheader'}
<li class="sectionheader"><span> {$node->menutext} </span>
{elseif $node->type == 'separator'}
<li class="seperator">
{elseif $node->depth == '1'}
<li><h2><a href="{$node->url}">{$node->menutext}</a></h2>
{else}
<li><a href="{$node->url}">{$node->menutext}</a>
{/if}
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}
</li></ul></div>
<div class="foot_nav">
<ul>
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{if $node->hierarchy|version_compare:'2.7':'>=' && $node->hierarchy|version_compare:'2.9':'<'}
{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
<li><h2><a class="active" href="{$node->url}">{$node->menutext}</a></h2>
{elseif $node->current == true and $node->depth == '1'}
<li><h2><a href="{$node->url}">{$node->menutext}</a></h2>
{elseif $node->haschildren == true}
<li><h2><a class="menuparent" href="{$node->url}">{$node->menutext}</a></h2>
{elseif $node->type == 'sectionheader'}
<li class="sectionheader"><span> {$node->menutext} </span>
{elseif $node->type == 'separator'}
<li class="seperator">
{elseif $node->depth == '1'}
<li><h2><a href="{$node->url}">{$node->menutext}</a></h2>
{else}
<li><a href="{$node->url}">{$node->menutext}</a>
{/if}
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}
</li></ul></div>
<div class="foot_nav">
<ul>
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{if $node->hierarchy|version_compare:'2.9':'>=' && $node->hierarchy|version_compare:'2.11':'<'}
{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
<li><h2><a class="active" href="{$node->url}">{$node->menutext}</a></h2>
{elseif $node->current == true and $node->depth == '1'}
<li><h2><a href="{$node->url}">{$node->menutext}</a></h2>
{elseif $node->haschildren == true}
<li><h2><a class="menuparent" href="{$node->url}">{$node->menutext}</a></h2>
{elseif $node->type == 'sectionheader'}
<li class="sectionheader"><span> {$node->menutext} </span>
{elseif $node->type == 'separator'}
<li class="seperator">
{elseif $node->depth == '1'}
<li><h2><a href="{$node->url}">{$node->menutext}</a></h2>
{else}
<li><a href="{$node->url}">{$node->menutext}</a>
{/if}
{assign var='temp_node_depth' value=$node->depth}
{/if}
{/foreach}
{repeat string="</li></ul>" times=$temp_node_depth-1}
</li></ul></div>
{/if}
The reason for this - element 2.7 has many child nodes2.1 Product 1 2.4 Product 4 2.7 Product 7 2.9 Product 9
2.1... 2.4... 2.7... 2.9...
...
2.2 Product 2 2.5 Product 5 2.8 Product 8 2.10 Product 10
2.2... 2.5... 2.8... 2.10...
2.3 Product 3 2.6 Product 6
2.3... 2.6...
Code: Select all
{if $node->hierarchy|version_compare:'2.7':'>=' && $node->hierarchy|version_compare:'2.9':'<'}
{* if hierarchy is higher or equal to 2.7 AND lower than 2.9 display menu as normaly*}
{/if}