|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
driverfiles Smarty Rookie
Joined: 10 Aug 2003 Posts: 26 Location: Epe, The Netherlands
|
Posted: Fri Oct 24, 2003 12:21 pm Post subject: Problem with nested section |
|
|
I have the following nested sections:
Code: |
{section name=groep loop=$subgroepen}
<tr align="center" valign="middle" bordercolor="#990000">
<td bgcolor="#FFBA75" width="25%">
<font class="normal">
<a href="?page=groepen&ID={$subgroepen[groep].ID}">{$subgroepen[groep].naam}</a></font>
</td></tr>
<tr align="left" valign="top">
<td width="25%">
<font class="small">{section name=nieuw loop=$nieuw_ads}
{$subgroepen[groep].ID}
{$nieuw_ads[{$subgroepen[groep].ID}][nieuw].titel}
{if $subgroepen[groep].ID == $nieuw_ads[subgroepen][nieuw].gID}
{$nieuw_ads[subgroepen][nieuw].titel}
{/if}
{/section}
</font></font></td></tr>
{/section}
|
The problem appears on this line:
Code: |
{$nieuw_ads[{$subgroepen[groep].ID}][nieuw].titel}
|
I need an ID from the section above (the first section) but this doesn't work. {$nieuw_ads[{$subgroepen[groep].ID}][nieuw].titel}, this: {$subgroepen[groep].ID} should be 34 or 35 in this current loop. If I replace that line like this:
{$nieuw_ads[34][nieuw].titel} it does work, but I need to get {$subgroepen[groep].ID} working as it needs to be automated
Sorry for my english, I'm not a native speaker So to make it extra clear, I need an item from the section above (called ID) in the section below, like this {$nieuw_ads[ID_FROM_ABOVE_SECTION][nieuw].titel}
Please let me know how to do this. I know how to get a rownum from the section above, simply by using {$nieuw_ads[SUBGROEPEN][nieuw].titel}, but not an item from that loop.
Thanks |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Oct 24, 2003 7:51 pm Post subject: Re: Problem with nested section |
|
|
driverfiles wrote: | The problem appears on this line: Code: |
{$nieuw_ads[{$subgroepen[groep].ID}][nieuw].titel}
|
|
This comes up every so often You can not nest smarty tags within each other.
I'm not sure if this works:
{$nieuw_ads[$subgroepen[groep].ID][nieuw].titel}
but I know that this will work:
{assign var=ID value=$subgroepen[groep].ID}
{$nieuw_ads[$ID][nieuw].titel} |
|
Back to top |
|
driverfiles Smarty Rookie
Joined: 10 Aug 2003 Posts: 26 Location: Epe, The Netherlands
|
Posted: Fri Oct 24, 2003 8:23 pm Post subject: |
|
|
Thank you so much for your help Boots. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|