Store and Use variables
From GruppoZenit
Revision as of 13:57, 6 February 2014 by Administrator (Talk | contribs)
In Z-CMS, it is possible to store and retrieve attribute content values using as variables the two Z-CMS tags zcms:store and zcms:use.
Such tags can be inserted inside the page as follows:
<zcms:store var="parentmenu" attribute="menu_id"/> <zcms:use name="parentmenu"/>
Here, the value of the attribute "menu_id" is stored using the variable "parentmenu" and later it is retrieved using the variable name.
Example: using the "store" and "use" tags
The following example shows how to use the zcms:store and zcms:use tags.
<zcms:store var="start" value="1"/> <zcms:store var="title2" value="TITLE1"/> <zcms:is operation="NOT_EMPTY" value="$memory[start]"> <h1>Title</h1> <h2><zcms:use name="title2"/></h2> <zcms:is operation="EQUALS" var="start" value="1" > <zcms:store var="title2" value="TITLE2"/> <a href="">THIS IS A LINK</a> <zcms:else> THIS IS A LINK TOO </zcms:else> </zcms:is> TEST </zcms:is> <h2><zcms:use name="title2"/></h2>