From GruppoZenit
Jump to: navigation, search

zcms:include tag is a position identifier that indicates where to insert the dynamically created Widgets.

With the attribute values of "Widget" or "Menu" and "Type", the dynamic Widget code will be identified and placed within the defined area.

Attribute Definition
Widget Optional.

Name that map to the code snippet

Menu Optional.

Name that map to the code snippet

Type Required.

Unique identifier to identify the widget

Datacount Optional.

Defines the how many contents to be displayed.

standalone Optional.

Makes the widget standalone by creating a separate file for the widget code instead of including it in the same page.

Values can be "true" or "false".

global Optional.

To include a widget of type global. Values can be "true" or "false".

The "include" tag can also include the filters as its child tag. So at the time of including the Widgets this filters will be added to the Content Model specified in this filters. The tag can also pass values to the Widget.

Example: using the include tag with filters and passing values

<zcms:include widget="sample" type="test" class="testclass">
   <zcms:global-filters name="mycontent">
      <zcms:filter attribute="publish" value="1" plaintext="true"/>
      <zcms:filter attribute="fk_menu_id" value="IS NULL" plaintext="true" clause="true"/>

For above example the the filters will be applied to the Global content model named "mycontent". The class used in the include tag acts a variable and the value "testclass" can be retrieved using the symbol "@". If the Widget has below shown code

<div class="@[class]" >Test</div> 

The @[class] will be replaced with the value passed, in this case as "testclass".

See also

Personal tools