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

cycle reset

 
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 -> Feature Requests
View previous topic :: View next topic  
Author Message
douglassdavis
Smarty Junkie


Joined: 21 Jan 2008
Posts: 541

PostPosted: Mon Mar 31, 2008 12:21 am    Post subject: cycle reset Reply with quote

I think if I am resetting a cycle and not printing it or assigning it, then the values attribute should not be required.

In that case, the cycle is only being reset to be used later, so the values attribute would be given then. For example:




Code:

{section name=outer loop=$outer_data}
   {* resets go here *}
    <tr>
       <td>Header goes here</td>
    </tr>

   {section name=rows loop=$data}
     <tr bgcolor="{cycle name=colors values="#eeeeee,#d0d0d0"}">
        <td>{$data[rows]}</td><td>{$outer_data[outer]}</td>
     </tr>
   {/section}
{/section}


For the inner section, the first color should be #eeeeee each time after the header.

I think {cycle name=colors print=false reset=true} should be sufficient to put in the outer loop to reset it. There is no reason to add the values in that case. If I try that it gives me an error though, so I have to add values="".
Back to top
View user's profile Send private message
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 -> Feature Requests 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