one for the gurus Please Help

From: Date: Sun, 07 Aug 2005 19:52:19 +0000
Subject: one for the gurus Please Help
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12918@lists.php.net to get a copy of this message
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

« previous php.smarty.general (#12918) next »