Created by: michael Date: 08/10/2020

Introduction

This section describes how the Text part is used within the CMS in order to add individual text snippets to pages/content items. Multiple text parts can be added to Content Types as required,  allowing text snippets to be entered such as section headings/titles.

Tip

The Text part should only be used for entering short pieces of text, 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 Text part (as shown below) allows for the default template to be modified if required.

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 text part name is set to 'Text' as per the screenshot below, the text entered can be output using the following handlebars code {{Text.text}} had the part name been set to Text1 instead, the corresponding handlebars code would become {{Text1.text}}.

Additional HTML code can then be used to wrap the text input as required, for example if the text entered is designed to create a H2 tag, the following code could be used <h2>{{Text.text}}</h2>. Or to set a span value the following code could be used <span>{{Text.text}}</span>.

The default code snippet as shown in the screenshot image below makes use of the handlebars code, this is used to update the context of the properties inside the with block, this is optional and so writing {{Text.text}} and {{#with Text}}{{{text}}}{{/with}} will produce exactly the same output.

Content Item Settings

Each Text part added to a Content Type, will result in a corresponding text input field being added to the content item, allowing for a plain text string/value to be entered into the item as required.

There are no upper or lower length limits on the Text part. In most cases, text should be entered as plain text, no HTML code should be used.

Using the Part in Templates

The HTML/handlebars code snippet set within the Content Type Part Settings can be used as-is within the Template, or it can be overwritten and modified as required for each specific template.

For example, within a list template the Text part could be surrounded in less important span HTML tag, whereas in the main template file for that specific item, the heading may be used within an H2 HTML tag.