From GruppoZenit
Revision as of 18:46, 29 October 2013 by Administrator (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Z-CMS has the following markers "#" and "@[]" that can be used for specific purposes.

Consider the "#" marker.

Though "#" implies "do nothing" in Z-CMS, usage is restricted just to inform Z-CMS whether to append the Site context URL to a resource path or not.

Two relevant scenarios can be described:

  • Consider that a General Content Model is used to manage the banner of a site and the "image" Attribute of the particular Content Model is used to store an image required for the banner. While creating a Widget to contain the Content Model, image source must be set as follows:
<img src="#[zcms:attribute:image]" width="600" height="250" />

Here, the particular image is stored in the General perspective and hence it is not required to append the site context URL to the image path.

  • Consider here another scenario where it is required to provide a link to an external URL:
<zcms:is attribute="EXTERNAL_URL" operation="NOT_EMPTY">
   <a class="link" href="#[zcms:attribute:EXTERNAL_URL]" target="_blank">Click here</a>
   <a class="link" href="#" target="_blank">Click here</a>

Now consider the "@[]" marker.

It is used to create and point a user-defined variable in Z-CMS. Consider a scenario where it is required to pass values to a Widget when it is included in a webpage. Let the name of the Widget be "service" and its type be "menu":

      <a class="@[home]" href="" shape="rect"><zcms:content-static name="Link_Home" /></a>
      <a href="" shape="rect" target="_blank"><zcms:content-static name="Link_Secure" /></a>
      <a class="@[legal]" href="/legal_info" shape="rect"><zcms:content-static name="Link_Legal" /></a>
      <a class="@[contact]" href="/contact_us_map/world" shape="rect"><zcms:content-static name="Link_Contact" /></a>

<div class="txt"><zcms:content-static name="Copyright_text" /></div>

<zcms:include widget="Logo" type="footer">

Values to the Widget can be passed as follows through the user-defined variables when it is included in the webpage:

<zcms:include widget="service" type="menu" home="green" legal="red" contact="blue" />

See also

Personal tools