field

Defines a basic field. A basic field can contain text of any kind. You can, however, use the mime-type attribute to specify the allowed content more narrowly.

Defines a boolean field that can hold only one of two values (true or false) but may also be left unspecified. A boolean field is displayed as a check box in CUE.

Defines a URI field that may contain any valid URI. URI syntax is defined by RFC 2396 and RFC 2732.

Defines a schedule field. A schedule field contains a schedule start and end date, an event start and end time and an optional set of recurrence rules.

Defines a number field, which may contain any numeric value (including decimals).

Defines a link field. A link field is intended to contain the URI of some resource you want to make use of in some way. Link fields are most commonly used to contain references to binary objects such as images and media files; all binary objects in content items are referenced in this way.

Note that a content-type element may only contain one link field.

Defines an enumeration field. An enumeration field has a number of predefined values from which the user can choose. It can be configured to accept either a single choice or multiple choices using the multiple attribute.

Defines a date field, which may contain a date/time value. The date/time value is stored as a UTC time in ISO-8601 format - that is, YYYY-MM-DD'T' HH:mm:ss'Z'.

Defines a collection field, which can be used to hold a reference to an Atom feed entry.

Collection field values are represented in CUE by graphic components called tokens.

Syntax
<field
    name="NCName"
    id="NCName"?
    ( type="basic" mime-type="text" search="(store|index-store)" | type="(boolean|uri|schedule)" | type="number" | type="link" | type="enumeration" multiple="(true|false)"? | type="date" | type="collection" src="text" mime-type="text" select="(content|title|locator)" select="link" linkrel="text" )
  >
  <array/>?
  (<constraints>...</constraints>?ANY-FOREIGN-ELEMENT*<parameter/>*<annotation>...</annotation>*<rep:representations>...</rep:representations>?|<constraints>...</constraints>?ANY-FOREIGN-ELEMENT*<parameter/>*<annotation>...</annotation>*|<format>...</format>?<constraints>...</constraints>?ANY-FOREIGN-ELEMENT*<parameter/>*<annotation>...</annotation>*|<constraints>...</constraints>?ANY-FOREIGN-ELEMENT*<parameter/>*<annotation>...</annotation>*<relation>...</relation>|<enumeration>...</enumeration>+<constraints>...</constraints>?ANY-FOREIGN-ELEMENT*<parameter/>*<annotation>...</annotation>*|<constraints>...</constraints>?ANY-FOREIGN-ELEMENT*<parameter/>*<annotation>...</annotation>*|<constraints>...</constraints>?ANY-FOREIGN-ELEMENT*<parameter/>*<annotation>...</annotation>*)
    
  <options>...</options>?
</field>
Examples
  • This example defines a plain text field used to hold the title of an article.

    <field mime-type="text/plain" type="basic" name="title">
      <ui:label>Title</ui:label>
      <ui:description>The title of the article</ui:description>
      <constraints>
        <required>true</required>
      </constraints>
    </field>
  • This example defines an HTML text field used to hold the main body of an article. Note the use of the ui:style element to control the appearance of h1 elements in the field in Content Studio. You can specify a complete stylesheet inside this element.

    <field mime-type="application/xhtml+xml" type="basic" name="body">
      <ui:label>Body</ui:label>
      <ui:description>The body text of the article.</ui:description>
      <ui:style>h1 {color:red;}</ui:style>
    </field>
  • This example defines an enumeration field that allows the Content Studio user to select an option from a list.

    <field type="enumeration" name="review-type">
      <ui:label>Review Type</ui:label>
      <ui:description>Select the required type</ui:description>
      <enumeration value="film"/>
      <enumeration value="play"/>
      <enumeration value="book"/>
      <enumeration value="game"/>
    </field>
  • This example defines a constrained numeric field in which only numbers between 1 and 6 are allowed.

    <field type="number" name="score">
      <ui:label>Score</ui:label>
      <ui:description>Enter your rating</ui:description>
      <constraints>
        <minimum>1</minimum>
        <maximum>6</maximum>
      </constraints>
    </field>
  • This example defines a link field used to contain references to image objects.

    <field name="binary" type="link">
      <relation>com.escenic.edit-media</relation>
      <constraints>
        <mime-type>image/jpeg</mime-type>
        <mime-type>image/png</mime-type>
      </constraints>
    </field>
  • This example shows how a basic field is used to define image crop masks.

    <field mime-type="application/json" type="basic" name="representations">
      <ui:label>Image Versions</ui:label>
      <rep:representations type="image-versions">
        <rep:representation name="thumbnail">
          <rep:output width="100" height="100"/>
          <rep:crop/>
          <rep:resize/>
        </rep:representation>
        <rep:representation name="narrow">
          <rep:output width="500" height="400"/>
          <rep:crop/>
          <rep:resize/>
        </rep:representation>
        <rep:representation name="wide">
          <rep:output width="1000" height="800"/>
          <rep:crop/>
          <rep:resize/>
        </rep:representation>
      </rep:representations>
    </field>
Attributes
name="NCName"

The name of the field element. Note that no two fields belonging to the same panel may have the same name.

id="NCName" (optional)

The id of the field element. Set this attribute if you want to be able to reference this element using XInclude. Otherwise it is not required.

type="basic"

Specifies that this field is a basic field.

mime-type="text"

The MIME type of the field. Two values are supported by default:

text/plain (default)

A simple text editing field is displayed in Content Studio for this MIME type.

application/xhmtl+xml

A rich text editing field is displayed in Content Studio for this MIME type.

application/json

If the field also has a child rep:representations element, then an image cropping field is displayed in CUE for this MIME type.

The field will not display any value if it contains any invalid data.

You can, however, define MIME types of your own and write corresponding field editor plug-ins.

search="(store|index-store)" (optional)

Specifies that this attribute's parent field element is to be included in search results, and optionally indexed.

Allowed values are:

store

The field's content will only be included in search results.

index-store

The field's content will be both indexed and included in search results.

type="(boolean|uri|schedule)"

Defines the type of the field.

Allowed values are:

boolean
uri
schedule
type="number"

Specifies that this field is a number field.

type="link"

Specifies that this field is a link field.

type="enumeration"

Specifies that this field is an enumeration field.

multiple="(true|false)" (optional)

If set to true then the field will accept multiple user choices; it is displayed as a multiple-choice list in CUE. If set to false or unspecified then the field will only accept a single choice; it is displayed as a combo box in CUE.

type="date"

Specifies that this field is a date field.

type="collection"

Specifies that this field is a collection field.

src="text"

Contains a URI that references a resource with an application/atom+xml;type=feed representation. The entries in the referenced feed are presented as a set of alternatives (a drop-down field in CUE) from which the user can choose one value. You can include the name of the current publication in the resource URI using the placeholder {publication}. If the current publication is called mypub, for example, then Content Store will convert the URL http://mycompany.com/myfeed?publication={publication} to http://mycompany.com/myfeed?publication=mypub. This makes it possible for the addressed service to send different feed content for different publications.

mime-type="text"

Defines the MIME type of the field.

select="(content|title|locator)"

Specifies which part of the selected Atom entry's content is to be stored as the field value.

Allowed values are:

content

The content of the selected Atom entry's atom:content element is to be stored as the field value.

title

The content of the selected Atom entry's atom:title element is to be stored as the field value.

locator

The href attribute of one of the selected Atom entry's viz:locator elements is to be stored as the field value. There are two points to note in this case:

  1. viz:locator is a proprietary Vizrt Atom extension element belonging to the http://www.vizrt.com/types namespace.

  2. An Atom entry may contain several viz:locator elements. The field value is taken from the one with the correct MIME type: that is, the one with a type attribute that matches this element's mime-type attribute.

select="link"

Specifies that the href of one the selected Atom entry's atom:link elements is to be stored as the field value. The specific atom:link to be used is determined by the linkrel attribute.

linkrel="text"

Specifies an Atom link relation name that determines which atom:link element the field value will be taken from. This attribute is only used when the select attribute is set to link.