[opencms-dev] multiple template-elements

Roman Uhlig Maxity.de roman.uhlig at maxity.de
Mon Feb 1 13:07:13 CET 2010


 
Hello Polina,

thanks for the reply. 

Yes, I know the "ifexists" option of the <cms:template> tag. But what I meant is the handling when including such a page with <cms:include>, e.g. from inside a JSP. I can't use <cms:template> there (at least I'm getting an error when trying).

Kind regards,
Roman


-----Urspr√ľngliche Nachricht-----
Von: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] Im Auftrag von Polina Smagina
Gesendet: Montag, 1. Februar 2010 12:57
An: The OpenCms mailing list
Betreff: Re: [opencms-dev] multiple template-elements

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


_______________________________________________
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