Elements are the building blocks of a content type. They define the type of content your content composers can create. The element types define whether the content is a block of text, files, dates, links, or videos. In other words, restrict the type of content that they can create. For example, a composer can't add a video to a content type that doesn't include a video element.
Add elements to your content type
Adding the elements to your content type is as easy as dragging and dropping to the content form. When you create a content type, you can add your desired content blocks from the Design tab. You can choose between Basic and Custom elements.
Basic elements
The basic elements provided are simple, commonly used elements.
- Text element
-
The text element is used for adding plain text. You can use it for storing short text types such as metadata, bylines, or headings. Text elements with multiple entries are useful for adding lists of things. Your web developer can add formatting to this text by using CSS when the content is published.
- Image element
-
Add image elements as a place for content composers to add, edit, and upload images.
By default, your composers can add any valid image type to an image field including, JPG, JPEG, PNG, GIF, and SVG. You can restrict an image element to specific image file types. To restrict file types, add a check to the Allow only specific file types field.
Content composers frequently need different image renditions for various contexts. You can choose the image profile with the image renditions that you need for this image element. The image renditions are applied when an image is uploaded to this field.
- Category element
-
Use this Category element to classify content. It helps users find content when using searches and filters. Limit the categories that are available from the Limit category selection field. The categories options displayed here are the categories you created in this subscription.
- Date element
-
Use a date element to allow content composers to specify a date, time, or both for promotions, events, and more.
- File element
-
Use a file element to allow content composers to upload files to enhance their content. By default, composers can add any file type to a file field. You can restrict the file types by checking the Allow only specific file types checkbox.
- Video element
-
Use a video element to allow composers to add a video to their content. By default, composers can add any valid video type to a video field including, mp4 and MOV files. You can restrict the file types by checking the Allow only specific file types checkbox.
- Formatted text
-
The formatted text element allows composers to apply simple formattings. The formatted text element adds the format as HTML tags. The formatted text element is useful for longer sections of text, such as the body text for a blog. However, if you don't want your composers to apply any formatting, use a text element.
- Number element
-
The number element stores numeric values. You can set the number element to accept integers or decimal values. Then set a minimum and maximum for the numeric values.
- Link element
-
Use a link element to allow content composers to add links to external sites and pages. The link element has fields to provide text, URL, and a description for the link.
- Reference element
-
Use a reference element to allow content composers to link to other content items. You can restrict a reference element to specific content types.
- Toggle element
-
For simple options, use a toggle element to allow composers to choose between two options: yes or no. You can include a Lead in statement for the toggle option.
- Location element
-
Use a location element to define latitude and longitude for a location. You can use decimal degrees to define the precise latitude and longitude. Your developer can add a custom user interface to a location element. Then, users can select locations from a map.
- Option element
-
You can use the option element to define as many options as you need.
For example, you can create an option element to select the text color for some content. Each option label represents what displays to composers on the content form. The value is what the content item stores. An option might have blue and a hexadecimal value of #0000ff as labels.
Note: You can limit the file types for the image, file, and video elements. The Limit file types setting enabled by your admin trumps the setting you set here. For example, you allow .mov files to be added here. But if your admin had not listed .mov as allowed, content composers cannot upload .mov files.
Custom elements
When you reuse a group of elements with the same properties and functions, you can combine them. These combined set of elements become a single block of element. For example, say it is a standard practice in your company to use the author details in the articles you publish. And in the Article content type, you always have the following elements:
- A text element for the name.
- Another text element for the last name.
- An image element for the profile image.
You can create a separate content type with these three elements and make it into a custom element. After you create the content type, go to the details page. From the Advanced tab, turn the Add to custom element palette toggles to yes. Your new custom element is available. You can now drag and drop it in any content type you create from the custom elements tab. So you don't have to recreate these elements and configure them every time.
You can use custom elements to save default settings for element types. You can reuse the same default settings in other content types.
Understand the element settings
When you create a content type, you are creating a form to compose content. You set up the content form so that it is intuitive for the composers to work with them. You can configure these settings for the basic or custom elements.
Note: The settings for the custom element treats the elements within it as a single element.
Here are some of the settings to think about:
Basic settings
The basic settings vary depending on the element type you add. The following are some of the settings across all or most element types.
Label
The label names you choose should be meaningful in some way. For example, if the text element is to store a description, type "Product description" as the label.
Key name
The Key name value is stored as part of the content type. Developers use it to retrieve the content created from these elements.
Note: If you change the Key name-value later, it will break the content created using this content type.
Placeholder
The placeholder text is displayed in the field on a content form. Your placeholder text is a prompt for your composers. It disappears as soon as your composer starts typing.
For example, you might add a placeholder of Give your post an exciting headline to the heading of a blog post. Or add your website's home URL as a placeholder for a link element.
Mark element as required
You can set an element type as required by enabling This element is required checkbox. So your content composers cannot publish the content items using these elements empty. This setting ensures that the composers provide the information for the content type.
Help text
Help text provides additional information for your content composers. If you type text into this field, a help button appears next to the element field on the content form. When a composer clicks the help button, your help text displays to the composer. For example, you add a toggle element to select whether their content is a featured product or not. You can add help text explaining what would qualify as a featured product.
Allow multiple
Enabling this field provides the content composers the ability to add additional fields. They can keep adding the same element type depending on the content they are creating. For example, they can add multiple text fields to add paragraphs for text.
Format element
You can add formatting to the element field for the element types. Such as add define a width for the element field and define the number of lines.
Advanced settings
Search key
You can set a search key for the element types. Developers use it to identify this element type when they add a search feature to their website. Users can also use the search key to find content created using this content type and element type.
Custom user interface extensions
Custom user interface extensions define how an element functions in the content form. You can configure element types to display content from external systems. For example, you can present content from commerce as a drop-down option in a content form.
- Enable the Provide a custom user interface extension in the Advanced tab.
- Then, add the custom user interface .../index.html file path. Contact your developer to get the index.html path.
You can add customized elements such as a drop-down or chart element to the content form. Include a custom user interface setting to add customized elements. You can use the custom user interfaces to define the display and function of an element type.
Your developer creates the custom user interface and adds it as a custom element. You can then add the custom element to the content type. For more information about custom user interfaces, check out Custom user interfaces.
Hide elements
You can hide elements from content composers. You might want to hide certain element types from content composers. For example, when the element type contains data that is secure or stored in the backend. The data could be sensitive personal information stored in a database. You would not want everyone to access or see them.
Lock elements
You can lock elements so your content composers cannot edit the element field. You might want to use this feature when there is a piece of default information across all content.
Note: If you set the element type as required and lock it, you must provide the default value. If you use webhooks or a custom user interface for the element type, then a default value is not required.
Use for settings
Not all the elements you add to a content type need to store information that will be displayed in an app or on a website. Some element types can be used purely as a way of storing configuration options for a content item.
For example, a number element can specify the maximum number of items in a list.
To add a configuration element,
- Add an element to your content type.
- Then, select Use for settings from the Advanced tab. The element will then appear in the Settings tab of the content form. The settings elements are easily editable from the preview page.
Note: You can also drag and drop the element to the Settings tab.