The <cms:contentcheck> tag

This conditional tests if a xml content item does exist and reacts depending on the attribute value

Attributes:

Name Description Required
ifexists

Tests if the the content item does exist.

When accessing a content item with multiple values, the single values can accessed directly by adding the index of the value to the content item name:

elementname[index]

no
ifexistsone

Tests if one of the comma separated content items does exist.

When accessing a content item with multiple values, the single values can accessed directly by adding the index of the value to the content item name:

elementname[index]

ifexistsall

Tests if all of the comma separated content items do exist.

When accessing a content item with multiple values, the single values can accessed directly by adding the index of the value to the content item name:

elementname[index]

ifexistsnone

Tests if none all of the comma seperated content items does exist.

When accessing a content item with multiple values, the single values can accessed directly by adding the index of the value to the content item name:

elementname[index]

Body:

Any HTML, JSP or JSTL code of your template, this code will be processed if the condition of the contentcheck tag is true

Example usage:

Check if a single content item does exist

<cms:contentcheck ifexists="Title" >
...
</cms:contentcheck >

Check if one of the given content items does exist

<cms:contentcheck ifexistsone="Teaser[0],Teaser[2]" >
...
</cms:contentcheck >

Check if all content items do exist

<cms:contentcheck ifexistsall="Teaser[0],Teaser[1]" >
...
</cms:contentcheck >

Check if none of the given content items does exist

<cms:contentcheck ifexistsnone="Teaser[2],Teaser[3]"  >
...
</cms:contentcheck >