Boolean properties represent a true or false value and can be used to enable or disable features in your application.
To add a Boolean property to a template:
The following example shows the configuration of a Boolean property:
<ContentTemplate xmlns="http://endeca.com/schema/content-template/2008" xmlns:editors="editors" type="HeaderContent"> <!-- additional elements omitted from this example --> <ContentItem> <Name>Search Box</Name> <Property name="autoSuggestEnabled"> <Boolean>false</Boolean> </Property> <!-- additional elements omitted from this example --> </ContentItem> <!-- additional elements omitted from this example --> </ContentTemplate>
A Boolean editor provides a checkbox for Experience Manager users to specify the value of a Boolean property.
To add a Boolean editor:
Insert a
<editors:BooleanEditor>
element within<BasicContentItemEditor>
.Specify additional attributes for the editor:
Attribute Description propertyName
Required. The name
of the Boolean property that this editor is associated with. This property must be declared in the same template as the Boolean editor.enabled
If set to false
, the checkbox displays in Experience Manager but the value cannot be changed by the user. By default, checkboxes are enabled.
The following example illustrates a checkbox for specifying whether
auto-suggest search results should be enabled, with a default value of
false
:
<ContentTemplate xmlns="http://endeca.com/schema/content-template/2008" xmlns:editors="editors" type="HeaderContent"> <!-- additional elements omitted from this example --> <ContentItem> <Name>Search Box</Name> <Property name="autoSuggestEnabled"> <Boolean>false</Boolean> </Property> <!-- additional elements omitted from this example --> </ContentItem> <EditorPanel> <BasicContentItemEditor> <GroupLabel label="Auto-Suggest Configuration"/> <editors:BooleanEditor propertyName="autoSuggestEnabled" label="Enable Auto-Suggest" enabled="true"/> <!-- additional elements omitted from this example --> </BasicContentItemEditor> </EditorPanel> </ContentTemplate>