This section describes how the DataField part is used within the CMS in order to add individual snippets to pages/content items. This could be text. integers, floating points, dates or boolean fields. Multiple DataField parts can be added to Content Types as required, allowing snippets to be entered such as section headings/titles/dates.
Tip
The DataField part should only be used for entering short pieces of data, if any additional formatting is required e.g. bold, underline, adding links etc. you should use the Body part instead.
Content Type Settings
The Content Type Settings for the DataField part (as shown below) allows for you to choose the type of data which will be entered within the Content Item.
Content Item Settings
Each DataField part added to a Content Type, will result in a corresponding input field being added to the content item, allowing for a plain text string/integer value/date or boolean checkbox to be entered into the item as required.
Using the Part in Templates
The template code is used to determine how the text entered into the field (on each content item) will be displayed on the corresponding webpage.
Assuming the DataField part name is set to 'DataField', the string entered can be output using the following handlebars code {{this.DataField}} had the part name been set to Part1 instead, the corresponding handlebars code would become {{this.Part1}}.
Additional HTML code can then be used to wrap the DataField output as required, for example if the DataField is designed to show a title H2 tag, the following code could be used <h2>{{this.DataField}}</h2>. Or to set a span value the following code could be used <span>{{this.DataField}}</span>.