Contenttype field properties

Smartsite 7 - Smartsite 7.11

Contenttype field properties 

The following legacy contenttype field properties (ctfp's) are supported by most Smartsite 7 manager controls.

Name Default Description
Group   Sets the tabname on which the control should be available.
SortIndex   Sets the sortindex for the control.
Caption   Sets the caption for the control.
ctrl:Caption   Sets the caption for the control. Overrules the Caption contenttype field property.
ctrl:MaxLength Dependant on field type
(database field length is taken as default).
Sets the max length for text controls.
ctrl:Width Dependant on control- and field type. Sets the control width.
ctrl:Height Dependant on control- and field type. Sets the control height.
Nullable  

When this ctfp is set to "0", the control requires input (whether or not the underlying database field accept Null-values).

Notice that within Smartsite 7, the database field definition takes precedence if the field is set not to accept Null-values.

ctrl:Enabled 1

Sets the control to read-only when the ctfp's value equals "0".

This ctfp is only used when none of the contenttype field properties ReadOnly, cms:readonly and xf:readonly have been specified.

AllowEdit Default value is 7, which means the
contenttype field is visible in all situations.

This contenttype field property determines whether a contenttype field is visible to be edited.
It is implemented as bitmask:

  • Bit 0 (value=1): the contenttype field is only visible within Edit Item.
  • Bit 1 (value=2): the contenttype field is only visible within Add Item.
  • Bit 2 (value=4): the contenttype field is (also) visible when the item is a folder.

A special value for the AllowEdit property is 0. When this is the case, the contenttype field isn't visible in any action.

ReadOnly 0

Sets the control to read-only when the ctfp's value equals "1".

Note: As of Smartsite 7.1, the same bitmask used for AllowEdit is used for ReadOnly.

ctrl:Visible 1

Sets the visiblity for the control; when ctrl:Visible equals "0", the control will not be visible.

Overrules the AllowEdit contenttype field property.

Hidden 0

Sets the visiblity for the control; when Hidden equals "1", the control will not be visible.

Overrules the AllowEdit and ctrl:Visible contenttype field properties.

The table below lists the contenttype field properties which have been added, and which are applicable for the Smartsite 7 manager only.

Name Description
cms:control Sets the control type for the contenttype field. (Use to overrule the auto-determined control type, see above.)
cms:Group Sets the tabname on which the control should be available. Overrules the Group ctfp.
cms:SortIndex Sets the sortindex for the control. Overrules the SortIndex ctfp.
cms:caption Set the caption for the control. Overrules the Caption and ctrl:Caption contenttype field properties.
cms:readonly Sets the control to read-only when the ctfp's value equals "1". Overrules the ReadOnly ctfp.
xf:readonly

Using this ctfp, an XPath expression can be specified which determines whether or not the control must be set to read-only.

Overrules the cms:readonly, ReadOnly and ctrl:Enabled contenttype field properties.

cms:required

Boolean (0|1), indicating whether or not the control requires input.

Overrules the Nullable ctfp. However, when the database field definition does not allow Nulls, the control will always require input.

xf:required

Using this ctfp, an XPath expression can be specified which determines whether or not the control requires input.

Overrules the cms:required and Nullable contenttype field properties.
However, when the database field definition does not allow Nulls, the control will always require input.

cms:Visible When the cms:Visible ctfp equals "0", the control will be marked as not relevant (it will not be visible).
xf:relevant

Using this ctfp, an XPath expression can be specified which determines whether or not the control is relevant.

When a control is not relevant, it will not be visible. Overrules the cms:Visible ctfp.

xf:constraint

Using this ctfp, an XPath expression can be specified which determines whether or not the control's input is valid.

cms:hint

Optional ctfp, which sets the hint message (localization code) for a control. The hint message is usually displayed as html tooltip on a control.

cms:help Optional ctfp, which sets the help message (localization code) for a control. The help message is usually displayed within the right pane when the control has focus.
cms:alert Optional ctfp, which sets the alert message (localization code) for a control. The alert message is shown when the control's input isn't valid.
cms:htmldecodescheme Optional ctfp introduced in Smartsite 7.3, which can be used to set a custom HtmlDecodeScheme for a specific field/control. Supported values: None, SingleDecode and DoubleDecode.
lookuplimit Sets the maximum number of records that wil be shown in a list or dropdown control. The default value is 1000.

The cms:hint, cms:help and cms:alert default mechanism

The contenttype field properties cms:hint, cms:help and cms:alert are subject to localization processing. This means that the defaults for these properties will be set to a localization lookup code and the actual string message will be retrieved from either the database (using the view vwLocalizedStrings) or the built-in string resources. When specifying the ctfp, it is adviced to use the same strategy (that is, specify a localization lookup code as ctfp value and make sure there's a localized string available for this lookup code).

When one of these ctfp's has not been specified, default localization lookup codes are generated, which are used to see if there's a localization string available.
First the code pattern SMS.MGR.CONTENTTYPE.{CONTENTTYPECODE}.{FIELDNAME}_{HINT|HELP|ALERT} is used.

When there's no localization string available with this code, the code pattern SMS.MGR.CONTENTTYPE.{FIELDNAME}_{HINT|HELP|ALERT} is used.
If there's (also) no localization string available with this code pattern, cms:hint and cms:help will not be set to a default value.

However, cms:alert will be set to the generic localization lookup code INVALID_FIELD_VALUE (or INVALID_FIELD_VALUE_REQUIRED when the contenttype field has been marked as required).

For example, when the contenttype code equals "WP", the (logical) fieldname equals "Description" and the default for cms:alert needs to be determined:

  • Localization lookup code is set to "SMS.MGR.CONTENTTYPE.WP.DESCRIPTION_ALERT". If there's a localization string available for this code, that string will be used as default.
  • Otherwise, the localization lookup code is set to "SMS.MGR.CONTENTTYPE.DESCRIPTION_ALERT". If there's a localization string available for this code, that string will be used as default.
  • Otherwise (only for cms:alert), the localization string for the generic lookup code "INVALID_FIELD_VALUE" or "INVALID_FIELD_VALUE_REQUIRED" will be used.