|
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 |
alexh Smarty Rookie
Joined: 19 Feb 2004 Posts: 10 Location: London
|
Posted: Fri Aug 20, 2004 11:51 am Post subject: {if $smarty.section.customer.first} not working |
|
|
This statement refuses to evaluate and just skips over it. Has anyone else had this problem? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Aug 20, 2004 1:27 pm Post subject: |
|
|
Assuming your section name is "customer" it should work fine. Show it in context if you want more help. |
|
Back to top |
|
alexh Smarty Rookie
Joined: 19 Feb 2004 Posts: 10 Location: London
|
Posted: Fri Aug 20, 2004 1:35 pm Post subject: |
|
|
Thanks for your reply. What's happening is that it is not printing:
Code: | <tr>
<td class="topten_bold">Cast</td>
<td class="topten"> |
to open the table row on the first pass.
Code: | <table width="450" border="0" cellpadding="0" cellspacing="0" bgcolor="#F6F5F6" style="clear:left">
<!--{section name=actors loop=$cast}-->
<!--{if $cast[actors].isDirector == 0}-->
<!--{if $smarty.section.actors.first}-->
<tr>
<td class="topten_bold">Cast</td>
<td class="topten">
<!--{/if}-->
<!--{$cast[actors].firstName}--> <!--{$cast[actors].lastName}--><!--{if !$smarty.section.actors.last}-->,<!--{/if}-->
<!--{if $smarty.section.actors.last}-->
</td>
</tr>
</table>
<!--{/if}-->
<!--{/if}-->
<!--{/section}-->
|
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Aug 20, 2004 1:59 pm Post subject: |
|
|
My guess is that $cast[actors].isDirector != 0 on the first iteration, so that statement doesn't get evaluated. |
|
Back to top |
|
alexh Smarty Rookie
Joined: 19 Feb 2004 Posts: 10 Location: London
|
Posted: Fri Aug 20, 2004 2:23 pm Post subject: |
|
|
You are right, thanks a lot for your help. Sorry to report it as a bug! |
|
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
|