problems with nested sections
| From: | Joeri van Oostveen | Date: | Wed, 10 Jul 2002 19:16:26 +0000 |
| Subject: | problems with nested sections | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-5248@lists.php.net to get a copy of this message | ||
Want I want I'll try to explain:
I have a n number of sets, each set contains a n number of photos.
I want to display the photos and group then with each set.
I have the following (stripped) code
{section name=set loop=$ID_SETS}
<tr><td>
{section name=photo loop=$PHOTOS_ID[$ID_SETS[set]]}
<table><tr>
<td nowrap>{$PHOTOS_TITLE[$ID_SETS[set]][photo]}</td>
<td nowrap>{$PHOTOS_CLIENT[$ID_SETS[set]][photo]}</td>
<td nowrap>{$PHOTOS_PUB_DATE[$ID_SETS[set]][photo]}</td>
<td nowrap>{$SETNAME_SETS[set]}</td>
</tr></table>
{/section}
</td></tr>
{/section}
but I get the following error(s) - one of them is enough to explain :):
unknown tag - '$PHOTOS_TITLE[$ID_SETS[set]][photo]'
I need the value from $ID_SETS[set] to get the correct photos to display (the photos are linked with the set through its id)
the information is stored like this: $PHOTOS_TITLE[2]. When I replace the $ID_SETS[set] between the [ ] with a hard '2' then it works, but it has to be dynamic.
So how can I get the value of a variable in a section to use it for an other variable to create a section?
I hope I made the problem a little bit clear, and hopefully you have a solutions (or alternate way) because after a day getting errors I'm getting very tired of it..
thanks