Zcms:store and zcms:use

From GruppoZenit
Jump to: navigation, search

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.

The attribute value can be an attribute name or any internal attributes such as

  1. parent_record - The parent record field.
  2. cid - The content identifier of record.
  3. id - The id of record.
  4. language_code - language code of the record.
  5. publish - publish status of the record.
  6. [attributename]_alt - Returns the alternative text added from backend for image.
  7. [attributename]_thumb - returns the thumbnail path of image.
value The source of the value. It may be from request, memory, previous content or a constant.
tocase (since zcms1.6.8) case (afterwards) 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(depricated) Name of the location where the value is being stored
var 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