Difference between revisions of "Zcms:for"

From GruppoZenit
Jump to: navigation, search
 
(One intermediate revision by one user not shown)
Line 12: Line 12:
 
|}
 
|}
  
Below an example on how to use the "for" tag to create the option from 1900 to 2050:
+
Below an example on how to use the "for" tag to create a <p> from 1 to 10:
  
 
<pre style="white-space: pre-wrap;  
 
<pre style="white-space: pre-wrap;  
Line 19: Line 19:
 
white-space: -o-pre-wrap;  
 
white-space: -o-pre-wrap;  
 
word-wrap: break-word;">
 
word-wrap: break-word;">
<zcms:for start="1900" end="2050" var="chk" >
+
<zcms:for start="1" end="10" var="chk" >
 
   <p><zcms:use name="chk"/></p>
 
   <p><zcms:use name="chk"/></p>
 
</zcms:for>
 
</zcms:for>

Latest revision as of 18:37, 29 October 2013

zcms:for tag can iterate the contents specified in the body of the tag. Its attributes are the following:

Attribute Definition
start The starting point of the loop
end The ending point of the loop
var The variable to which the current index is stored

Below an example on how to use the "for" tag to create a <p> from 1 to 10:

<zcms:for start="1" end="10" var="chk" >
   <p><zcms:use name="chk"/></p>
</zcms:for>


[edit] See also

Personal tools
Namespaces

Variants
Actions
Toolbox