[opencms-dev] multiple template-elements

Polina Smagina p.smagina at alkacon.com
Mon Feb 1 12:57:25 CET 2010


Hello Roman,

to controll the inclusion of the page elements in the template the 
<cms:template> tag with "ifexists" can be used.

Example for the inclusion of an optional page element in the template code:
<cms:template ifexists="body2">
	<cms:include element="body2" editable="true" />
</cms:template>

Other possible conditions:

ifexistsone="element1,element2,…,elementN"
ifexistsnone="element1"
ifexistsall="element1,element2,…,elementN"

-- 
Kind Regards,
Polina

-------------------
Polina Smagina

Alkacon Software GmbH  - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org


Roman Uhlig Maxity.de schrieb:
> I tried to use multiple template elements via the "template-elements"
> property of the template JSP like that:
> 
> "text1*|Text,images*|Images,title*|Title"
> 
> Now when I create a new resource, only the "text1" node is created
> inside the XML. Is there any way to force OpenCms to always create all
> three elements?
> 
> If not, how could I check whether an element exists when using
> cms.include()?
> 
> Thanks in advance,
> Roman
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list