Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Problem with nested section

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
driverfiles
Smarty Rookie


Joined: 10 Aug 2003
Posts: 26
Location: Epe, The Netherlands

PostPosted: Fri Oct 24, 2003 12:21 pm    Post subject: Problem with nested section Reply with quote

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 Smile

Sorry for my english, I'm not a native speaker Smile 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 Smile
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Oct 24, 2003 7:51 pm    Post subject: Re: Problem with nested section Reply with quote

driverfiles wrote:
The problem appears on this line:
Code:

{$nieuw_ads[{$subgroepen[groep].ID}][nieuw].titel}


This comes up every so often Smile 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
View user's profile Send private message
driverfiles
Smarty Rookie


Joined: 10 Aug 2003
Posts: 26
Location: Epe, The Netherlands

PostPosted: Fri Oct 24, 2003 8:23 pm    Post subject: Reply with quote

Thank you so much for your help Boots.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP