Difference between revisions of "Zcms:store and zcms:use"

From GruppoZenit
Jump to: navigation, search
(zcms:store)
Line 70: Line 70:
 
By default the value is “false” and all media is removed and data is stored in a variable.
 
By default the value is “false” and all media is removed and data is stored in a variable.
 
|}
 
|}
 +
  
 
=== Example: using store tag ===
 
=== Example: using store tag ===
 +
  
 
<pre style="white-space: pre-wrap;  
 
<pre style="white-space: pre-wrap;  
Line 81: Line 83:
 
<zcms:store var="details" attribute="news_details" media="true"/>
 
<zcms:store var="details" attribute="news_details" media="true"/>
 
</pre>
 
</pre>
 +
  
 
== zcms:use ==
 
== zcms:use ==
Line 110: Line 113:
 
<div id="[zcms:use:data]"></div>
 
<div id="[zcms:use:data]"></div>
 
</pre>
 
</pre>
 +
 +
 +
== Predefined variables ==
 +
  
  

Revision as of 13:56, 6 February 2014

zcms:store and zcms:use tags stores information about the way a constant or a value from a Content Model is being stored in memory and retrieved.


Contents

zcms:store

This tag contains information about how the data are kept in the memory of Z-CMS.

Attribute Definition
var Name of the location where to store the value
attribute Name of the content attribute
value The source of the value. It may be from request, memory, previous content or a constant.
tocase Optional.

Convert the value between cases. Possible values are:

  1. upper --> to upper case
  2. lower --> to lower case
  3. capitalize --> first letter as capital
  4. capitalize-all --> first letter of each word as capital
fromleft Optional.

Number of characters to be displayed from left.

format Optional.

To format the content data. Formatting options are available for the attribute types:

  1. Date
  2. Number
locale A valid country code. Possible codes are:

AR | ZH | DE | EN | ES | FR | IT | JA | PT | RU

useformat Name of the previously declared format rule.

Example:

<zcms:dateformat id="dtformat1" />

The name to be used for the attribute useformat is "dtformat1":

<zcms:attribute name="dt" useformat="dtformat1" />
typeof A type identifier to be applied at the time of conversion. Possible values are:

INTEGER, LONG, DECIMAL, DATE Example:

<zcms:store var="value1" value="10000" locale="it" typeof="integer" />
scope Optional attribute, which defines the scope of the data. By default the scope will be within the page. By specifying "GLOBAL", the value will be visible globally.
media Optional

If “true” will store the data with media contents inside the description from an attribute. By default the value is “false” and all media is removed and data is stored in a variable.


Example: using store tag

<zcms:store var="data" value="myvalue"/>
<zcms:store var="details" attribute="news_details" media="true"/>


zcms:use

This tag contains information about the retrieval of data from the memory.

Attribute Definition
name Name of the location where the value is being stored


Example: using use tag

In the following lines is shown how to use a stored variable inside a page:

<zcms:use name="data"/>

or as attribute:

<div id="[zcms:use:data]"></div>


Predefined variables

See also

Personal tools
Namespaces

Variants
Actions
Toolbox