Re: nested template question
| From: | Ivo Jansch | Date: | Tue, 27 Mar 2001 09:49:32 +0000 |
| Subject: | Re: nested template question | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-445@lists.php.net to get a copy of this message | ||
Hi,
Maciek Uhlig wrote:
> The subject says your templates are nested while in fact they are not.
Yes they are: item.tpl is nested inside index.tpl.
> Therefore in your case the section names need not be unique, they can have
> the same name, right?.
No, I tried that. Smarty can't handle two sections with the same name
(in this situation).
> So, wouldn't be the following the solution?
> {section name=mysection loop=$mybookmarks}
> {include file="item.tpl}
> {/section}
> <br><br>Your bookmarks:
> {section name=mysection loop=$yourbookmarks}
> {include file="item.tpl}
> {/section}
I tried this exact example, and the result is that for both sections,
$yourbookmarks are displayed. This is because Smarty stores the assigned
variables by section name I guess, overwriting $mybookmarks.
Greetings,
Ivo
--
Ivo Jansch <ivo@ibuildings.nl>
ibuildings.nl BV - information technology
http://www.ibuildings.nl