Re: nested template question

From: Date: Tue, 27 Mar 2001 12:05:54 +0000
Subject: Re: nested template question
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-447@lists.php.net to get a copy of this message
Hi, Maciek Uhlig wrote: > Watch how: > - associative arrays are used in item.tpl (key and value are separated with > a period) > - table variable is passed to item.tpl > - section name is reused ("mysection") > - item.tpl is reused as you requested. Great! Works fine! Only drawback is that item.tpl must know in which section it will be used. But I found a way to fix that too.. It's similar to your solution, only the section is moved to indexitem.tpl: {section name=mysection loop=$yourbookmarks} {include file="item.tpl" table=$mysection/yourbookmarks} {/section} Then item.tpl can be: <a href="{$table.url}">{$table.name}</a> Which is even nicer. So thanks a lot for your solution! Greetings, Ivo -- Ivo Jansch <ivo@ibuildings.nl> ibuildings.nl BV - information technology http://www.ibuildings.nl

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