Cms:container

From OpenCms Wiki
(Difference between revisions)
Jump to: navigation, search
(Added example)
(Format)
 
(3 intermediate revisions by one user not shown)
Line 30: Line 30:
 
  <small>opencms.tld</small>
 
  <small>opencms.tld</small>
  
The <tt>type</tt> attribute can be used to select '''which formater will be used''': "''Which formatter JSP is used for which container can be configured either in the resource type schema or in the site map configuration''" [[Creating OpenCms 8 Container Templates#Formatter Configuration]]
+
The <tt>type</tt> attribute can be used to select '''which formatter will be used''': "''Which formatter JSP is used for which container can be configured either in the resource type schema or in the site map configuration''" (see [[Creating OpenCms 8 Container Templates#Formatter Configuration|Creating OpenCms 8 Container]])
  
 
=== maxElements ===
 
=== maxElements ===
Line 83: Line 83:
 
The jsp template code:
 
The jsp template code:
  
 +
<source lang="html4strict">
 
   <cms:container name="infocontainer" tag="code" tagClass="myClass" />
 
   <cms:container name="infocontainer" tag="code" tagClass="myClass" />
 +
</source>
  
Will rendered:
+
Will render:
  
 +
<source lang="html4strict">
 
   <code id="infocontainer" class="myclass GH3XNNECNL"></code>
 
   <code id="infocontainer" class="myclass GH3XNNECNL"></code>
 +
</source>

Latest revision as of 10:41, 21 August 2012

Contents

cms:container tag

This page extends the opencms.tld scarce documentation for the cms:container tag.

  <tag>
       <description>
           This tag enables the template mechanism for container pages.
       </description>
       <name>container</name>
       <tag-class>org.opencms.jsp.CmsJspTagContainer</tag-class>
       <body-content>empty</body-content>
opencms.tld

cms:container attributes

name

       <attribute>
           <name>name</name>
           <required>true</required>
           <rtexprvalue>true</rtexprvalue>
       </attribute>
opencms.tld

Sets the container name. It will be rendered as the id value of the tag.

type

       <attribute>
           <name>type</name>
           <required>false</required>
           <rtexprvalue>true</rtexprvalue>
       </attribute>        
opencms.tld

The type attribute can be used to select which formatter will be used: "Which formatter JSP is used for which container can be configured either in the resource type schema or in the site map configuration" (see Creating OpenCms 8 Container)

maxElements

       <attribute>
           <name>maxElements</name>
           <required>false</required>
           <rtexprvalue>true</rtexprvalue>
       </attribute>
opencms.tld

width

       <attribute>
       	<name>width</name>
       	<required>false</required>
       	<rtexprvalue>true</rtexprvalue>
       </attribute>
opencms.tld

tag

       <attribute>
       	<name>tag</name>
       	<required>false</required>
       	<rtexprvalue>true</rtexprvalue>
       </attribute>
opencms.tld

The default tag name that will be rendered is div, but this can be overriden (see the example below).

tagClass

       <attribute>
       	<name>tagClass</name>
       	<required>false</required>
       	<rtexprvalue>true</rtexprvalue>
       </attribute>
opencms.tld

Sets the class of the rendered tag (see the example below).

detailView

       <attribute>
       	<name>detailview</name>
       	<required>false</required>
       	<rtexprvalue>true</rtexprvalue>
       </attribute>
   </tag>
opencms.tld

Sets if the current container is target of detail views.

Example

The jsp template code:

  <cms:container name="infocontainer" tag="code" tagClass="myClass" />

Will render:

  <code id="infocontainer" class="myclass GH3XNNECNL"></code>
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox