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

{if $smarty.section.customer.first} not working

 
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 -> Bugs
View previous topic :: View next topic  
Author Message
alexh
Smarty Rookie


Joined: 19 Feb 2004
Posts: 10
Location: London

PostPosted: Fri Aug 20, 2004 11:51 am    Post subject: {if $smarty.section.customer.first} not working Reply with quote

This statement refuses to evaluate and just skips over it. Has anyone else had this problem?
Back to top
View user's profile Send private message MSN Messenger
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Aug 20, 2004 1:27 pm    Post subject: Reply with quote

Assuming your section name is "customer" it should work fine. Show it in context if you want more help.
Back to top
View user's profile Send private message Visit poster's website
alexh
Smarty Rookie


Joined: 19 Feb 2004
Posts: 10
Location: London

PostPosted: Fri Aug 20, 2004 1:35 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Aug 20, 2004 1:59 pm    Post subject: Reply with quote

My guess is that $cast[actors].isDirector != 0 on the first iteration, so that statement doesn't get evaluated.
Back to top
View user's profile Send private message Visit poster's website
alexh
Smarty Rookie


Joined: 19 Feb 2004
Posts: 10
Location: London

PostPosted: Fri Aug 20, 2004 2:23 pm    Post subject: Reply with quote

You are right, thanks a lot for your help. Sorry to report it as a bug! Embarassed
Back to top
View user's profile Send private message 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 -> Bugs 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