Under Community Review

System has couple of ways to have boolean field type (and you already  mentioned some):

- text field with a list of values

- keywords

- even simple input field with predefined value

It is also interesting to know what default values are expected then:

- true/false

- yes/no

- 1/0

Since values will be passed as is to Content Delivery side

Boolean field type

To have boolean flags in a schema you need to use a text field type and add the truthy and falsy values as a list. This also results in having to have custom models for evaluating from a string value to a boolean in content delivery.

Can we add a boolean field type as a system type with a toggle ux?

It's a simple extension of the system field types that shouldn't take long and fits within the XSD paradigm: http://books.xmlschemata.org/relaxng/ch19-77025.html

  • This has always been missing, given that XML Schema has boolean as a primitive type. Very often a boolean is not represented by a text value.

  • Hi Andrew,

    The content delivery implementation would leverage the Boolean primitive which is a system type in either Java or C# and thus would use the true/false values coerced from the XML Boolean type.

    You don't even need to worry about nullable types for non-mandatory fields since in the case of no value being set in the CMS the property would be omitted from content delivery completely.

    As such the content delivery update would be as simple as adding a BooleanValue to the model(s) and supporting it in semantic mapping for higher level abstractions such as DD4T and DXA etc. Since boolean is a value type in JSON there is no complication in serialization between Authoring and Delivery.

    Best,

    John

  • Hi John,

    System has couple of ways to have boolean field type (and you already  mentioned some):

    - text field with a list of values

    - keywords

    - even simple input field with predefined value

    It is also interesting to know what default values are expected then:

    - true/false

    - yes/no

    - 1/0

    Since values will be passed as is to Content Delivery side