Difference between revisions of "Zcms:for"

From GruppoZenit
Jump to: navigation, search
(Created page with "'''zcms:for''' tag can iterate the contents specified in the body of the tag. Its attributes are the following: :{|class="wikitable" !Attribute ||Definition |-...")
 
 
(13 intermediate revisions by 4 users 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:content-form name="formdata" type="INSERT" key="id" action="saveuser" method="post">
+
<zcms:for start="1" end="10" var="chk" >
<zcms:component type="select" attribute="title" >
+
  <p><zcms:use name="chk"/></p>
          <option value="">Select</option>
+
</zcms:for>
<zcms:for start="1900" end="2050" var="chk" >
+
                    <option  value="[zcms:use:chk]" ><zcms:use name="chk"/></option>
+
                  </zcms:for>
+
 
+
</zcms:component>
+
<zcms:status event="SUCCESS" url="udaptefrm?id=@@[id]">Inserted</zcms:status>
+
</zcms:content-form>
+
<zcms:submit form="formdata">
+
<div class="divclass">Click</div>
+
</zcms:submit>
+
 
</pre>
 
</pre>
  
Line 39: Line 29:
  
 
* [[Tag library]]
 
* [[Tag library]]
 +
* [[Zcms:store and zcms:use#zcms:use|zcms:use]]

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