|
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 |
douglassdavis Smarty Junkie
Joined: 21 Jan 2008 Posts: 541
|
Posted: Mon Mar 31, 2008 12:21 am Post subject: cycle reset |
|
|
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 |
|
|
|
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
|