Posted by Gregory Machin on 09/30/39 11:23
Hi
please help.
I'm trying to create a foldout menu that can go infinatly deep.
It has some java and css.
but what i cant get rite is to generate the correct html out put..
this is an example of what i'm trying to get ..
<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">About</a>
<ul>
<li><a href="#">History</a></li>
<li><a href="#">Team</a></li>
<li><a href="#">Offices</a></li>
</ul>
</li>
<li><a href="#">Services</a>
<ul>
<li><a href="#">Web Design</a></li>
<li><a href="#">Internet
Marketing</a></li>
<li><a href="#">Hosting</a></li>
<li><a href="#">Domain Names</a></li>
<li><a href="#">Broadband</a></li>
</ul>
</li>
</ul>
the problem is the parent child relation and geting the correct tags
in the correct place ..
this is what i'm working from but i can't get the logic to work :-/
<ul id="nav">
{foreach from=$sections item=section}
{assign var=commonParent value=1}
{foreach from=$current->parents item=parentId}
{if $parentId == $section->id || $parentId == $section->parent}
<ul>
{assign var=commonParent value=1}
{/if}
{/foreach}
{if $section->numParents == 0 || $commonParent || $section->id ==
$current->id || $section->parent == $current->id}
<li><a href="{$section->link}" class="navlink"{if $section->new_window}
target="_blank"{/if}>{$section->name}</a>
</li></ul>
{/if}
{/foreach}
</ul>
many thanks
--
Gregory Machin
greg@linuxpro.co.za
gregory.machin@gmail.com
www.linuxpro.co.za
Web Hosting Solutions
Scalable Linux Solutions
www.iberry.info (support and admin)
www.goeducation (support and admin)
+27 72 524 8096
Navigation:
[Reply to this message]
|