[SMARTY] one for the gurus Please Help

Gregory Machin <[email protected]>
Newsgroups gmane.comp.php.smarty.general
Message-ID <[email protected]>
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
[email protected]
[email protected]
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

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.