Typical usage formats

From GruppoZenit
Jump to: navigation, search

Z-CMS provides usage formats to enable manipulation of parameter values inside attributes Request, Session and Context within Z-CMS tags.


These typical usage formats can be manipulated only within Z-CMS tags to obtain the parameter values. Such usages will not return or show any value and hence they cannot be exposed. zcms:use tag can be used in cases where these values are to be exposed.


Typical usage formats are listed in the following table:

Function Purpose
$request[<parameter>] To make available a parameter value from Request

(Ex. $request[lang] makes available the value of the parameter "lang" from the request)

$session[<parameter>] To make available a parameter value from Session
$result[<contentmodel>, <field>] To make available the content data for a particular attribute of a Content Model at the current content position
$result[*parent, <field>] To make available the content data for a particular attribute of the parent Content Model with respect to the current content position

(refer to the example given below)

$context[<parameter>] To make available a parameter value from Context
$memory[<parameter>] To make available a value from memory

(Ex. Value of the variable which is stored using the zcms:store tag)

Note: the value of the variable that is stored using the zcms:store tag can be retrieved using the zcms:use tag but it will not favour manipulation of the value within Z-CMS tags.


An example of usage formats is given below:

<zcms:is attribute="menu_id" operation="EQUALS" value="$request[menuid]"/>
<zcms:is operation="EMPTY" value="$request[$4]">


Example: adding typical usage formats inside a page

In the following lines is shown how to use Z-CMS typical formats:

<zcms:content name="Con_states" id ="c">
   <zcms:filter attribute="state_id" value="$request[$1]"/> 
   <zcms:store var="parent_record" attribute="parent_record"/>
   <zcms:datacolumn name="parent_record" alias="parent_record" />
      <div class="int_tit">
         <h1 class="det_tit"><zcms:attribute name="State_name"/></h1>
         <zcms:include widget="Contacts" type="select_states" in_list="1"/>
      </div>
</zcms:content>

<zcms:content name="Contacts">
   <zcms:store var="parent_record" attribute="parent_record"/>
   <zcms:filter attribute="State_look" value="$memory[parent_record]"/>
   <div class="country">  
   <div class="cl">
      <h2><zcms:attribute name="Title"/></h2>
      <p><zcms:attribute name="Contact"/></p>
   </div>
      <zcms:is operation="NOT_EMPTY" attribute="Image">
         <img src="[zcms:attribute:Image]" width="165" height="200" />
      </zcms:is>
   </div>  
</zcms:content>

<zcms:content name="Exhibition">
   <zcms:datacolumn name="parent_record" alias="parent_record" />
   <zcms:dataorder attribute="priority" order="asc"/>
   <div class="news_ex">
      <p class="tit"><zcms:attribute name="Exhibition" /></p>
   </div>
<zcms:content name="Ex_events">
   <zcms:dataorder attribute="priority" order="asc"/>
   <zcms:filter attribute="exhibition" value="$result[*parent,parent_record]" />
   <div class="news_ex_tab">
   <div class="cl1">
      <p class="txt"><span><zcms:content-static name="Exhibition_Date"/></span></p>
   </div>
   <div class="cl2">
      <p class="txt"><span><zcms:content-static name="Exhibition_Event"/></span></p>
   </div>
   </div>
</zcms:content>
</zcms:content>


See also

Personal tools
Namespaces

Variants
Actions
Toolbox