Field types
This page lists all core field types available for your API, as well as sample queries to create and retrieve content for these through the API.
Text
The Text field has multiple applications, it can be used as a single line, multi line, html, wysiwyg editor. And is also the field type used for all the dynamic content text fields. Like H1, H2, ..., Paragraphs, and code blocks.
When using a standalone text field (e.g single line, multi line, html wysiwyg) you don't need to specify a format. However when using either headings or code in your dynamic content editor you do need to specify a format.
PARAMETER VALUE | UI FUNCTIONALITY | API VAlUE |
---|---|---|
H1 | H1 input field | body without HTML and format specified |
H2 | H2 input field | body without HTML and format specified |
H3 | H3 input field | body without HTML and format specified |
H4 | H4 input field | body without HTML and format specified |
H5 | H5 input field | body without HTML and format specified |
H6 | H6 input field | body without HTML and format specified |
Code | raw HTML input field | body contains HTML and format specified (this will be used for the UI editor) |
null | basic WYSIWYG editor input field. (bold, italic, list, list with numbers, link/url) | body contains HTML and no format specified |
{
"id": "gmQh3QLgu80l1QLMg9qUj6nwr97YxqkbPhhUf7rO",
"created_on": "2023-01-01T09:56:21+00:00",
"changed_on": null,
"label": "Text",
"body": "As easy as appelbol",
"format": null
}
{
"body": "Excuse my french toast",
"label": "Text",
"format": "H1"
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
body | String | true | Defines the title. |
label | String | false | Label Text, is only required in Dynamic content field (i.e., ElementBox). |
format | String | false | H1, H2, H3, H4, H5, H6, CODE, null, is applied to Dynamic content field (i.e., ElementBox). |
Dynamic content
The Dynamic content field enables editors for a next-level authoring experience. Embed videos, social media posts, maps, assets, and components to create rich content items.
// A dynamic content item can be build up with many different type of fields. And it will return those fields in an array called items.
{
"items": [
{
... // Sub-field
},
{
... // Sub-field
}
],
"label" : "ElementBox"
}
// An example of a dynamic content field with multiple fields:
"content": {
"items": [
{
"id": "734a1153-aac7-4df6-b737-31c9384820fb",
"created_on": "2023-03-09T15:12:12+00:00",
"changed_on": null,
"label": "Text",
"body": "<p>As far back as I can remember, I've always eaten french toast. It was usually a quick Sunday morning breakfast instead of pancakes or the go-to snack to use up the last stale bread slices. This is one of the easiest recipes that you can find for a quick treat.</p>",
"format": null
},
{
"items": [
{
"id": "fc64d492-cb4e-44cc-aa0d-8f454ac5db5a",
"created_on": "2023-03-09T14:16:39+00:00",
"changed_on": "2023-03-09T14:16:47+00:00",
"label": "Photo",
"name": "French toast",
"body": null,
"author": null,
"status": null,
"replaceable": true,
"reference_id": null,
"width": 3024,
"height": 4032,
"extension": "jpg",
"original_name": "4tq8iogbqhfi-pexels-sean-stevens-4623075",
"mime_type": "image/jpeg"
}
],
"label": "Asset"
},
{
"id": "93fb6bce-aed8-4f5d-b675-f372e9c45941",
"created_on": "2023-03-09T15:12:12+00:00",
"changed_on": null,
"label": "Text",
"body": "Ingredients",
"format": "H2"
},
{
"id": "1dfd0aff-c123-493d-8a2b-674424c5028c",
"created_on": "2023-03-09T15:12:12+00:00",
"changed_on": null,
"label": "Text",
"body": "Ingredients",
"format": "H2"
},
{
"id": "10634600-89e4-4dfa-8b65-0689b47e3258",
"created_on": "2023-03-09T15:12:12+00:00",
"changed_on": null,
"label": "Text",
"body": "<ol><li><strong>Bread</strong> slices</li><li><strong>Eggs</strong> (1 per person)</li><li>A dash of <strong>milk</strong></li><li><strong>Sugar</strong> or <strong>powdered sugar</strong> or <strong>maple syrup</strong> or <strong>honey</strong></li><li><strong>Cinnamon</strong></li><li><strong>Butter</strong> for frying (This is my preferred taste, but any other neutral cooking oil will do the job)</li><li><strong>Salt</strong></li></ol>",
"format": null
},
{
"id": "f287dba0-42da-4598-86c6-30c0ac71154a",
"created_on": "2023-03-09T15:12:12+00:00",
"changed_on": null,
"label": "Text",
"body": "Method",
"format": "H2"
},
{
"id": "d507f1e0-e1fa-47ee-bb7f-9cdef4a4ecd3",
"created_on": "2023-03-09T15:12:12+00:00",
"changed_on": null,
"label": "Text",
"body": "<ol><li>Beat your eggs with some milk (about a tablespoon per egg), a pinch of salt and cinnamon.</li><li>Heat up a frying pan to medium heat and add some butter to cover the bottom.</li><li>Dip each slice of bread into the mixture for about 20 seconds on each side.</li><li>Fry your slices until they are golden brown on each side.</li><li>Once done, plate them and sprinkle with sugar/maple syrup/honey and cinnamon.</li></ol>",
"format": null
},
{
"id": "0b05a9e3-b057-4ecf-8904-c66bbd36df04",
"created_on": "2023-03-09T15:12:12+00:00",
"changed_on": null,
"label": "Text",
"body": "Tips to kick it up a notch",
"format": "H3"
},
{
"id": "56e42b53-b709-49f0-94e4-3b743a01a420",
"created_on": "2023-03-09T15:12:12+00:00",
"changed_on": null,
"label": "Text",
"body": "<ol><li>Top the toast with some fresh seasonal fruit like sliced strawberries, sliced bananas or blueberries.</li><li>Caramelize sliced up bananas with butter and sugar (brown is the tastiest) as a topping.</li><li>Make a french toast tower, by alternating with your toppings and slices. Drizzle the maple syrup or honey on top.</li></ol>",
"format": null
}
],
"label": "ElementBox"
}
// This example shows how to create the dynamic content part of the article pattern at https://patterns.prepr.io/blog/excuse-my-french-toast
// The request structure is as follows:
// You have an array of items, each item contains the information and label for a specific field.
{
"items": [
{
"body": "<p>As far back as I can remember, I've always eaten french toast. It was usually a quick Sunday morning breakfast instead of pancakes or the go-to snack to use up the last stale bread slices. This is one of the easiest recipes that you can find for a quick treat.</p>",
"label": "Text"
},
{
"label": "Asset",
"items": [
{
"id": "efb226d5-4094-479c-9a49-60bf5d42d83a"
}
]
},
{
"body": "Ingredients",
"label": "Text",
"format": "H2"
},
{
"body": "Ingredients",
"label": "Text",
"format": "H2"
},
{
"body": "<ol><li><strong>Bread</strong> slices</li><li><strong>Eggs</strong> (1 per person)</li><li>A dash of <strong>milk</strong></li><li><strong>Sugar</strong> or <strong>powdered sugar</strong> or <strong>maple syrup</strong> or <strong>honey</strong></li><li><strong>Cinnamon</strong></li><li><strong>Butter</strong> for frying (This is my preferred taste, but any other neutral cooking oil will do the job)</li><li><strong>Salt</strong></li></ol>",
"label": "Text"
},
{
"body": "Method",
"label": "Text",
"format": "H2"
},
{
"body": "<ol><li>Beat your eggs with some milk (about a tablespoon per egg), a pinch of salt and cinnamon.</li><li>Heat up a frying pan to medium heat and add some butter to cover the bottom.</li><li>Dip each slice of bread into the mixture for about 20 seconds on each side.</li><li>Fry your slices until they are golden brown on each side.</li><li>Once done, plate them and sprinkle with sugar/maple syrup/honey and cinnamon.</li></ol>",
"label": "Text"
},
{
"body": "Tips to kick it up a notch",
"label": "Text",
"format": "H3"
},
{
"body": "<ol><li>Top the toast with some fresh seasonal fruit like sliced strawberries, sliced bananas or blueberries.</li><li>Caramelize sliced up bananas with butter and sugar (brown is the tastiest) as a topping.</li><li>Make a french toast tower, by alternating with your toppings and slices. Drizzle the maple syrup or honey on top.</li></ol>",
"label": "Text"
}
],
"label": "ElementBox"
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
items | Array | true | Array of fields you want to create. |
items.*.label | String | true | Label of the field you are using is required. |
label | String | true | Label ElementBox, is required. |
Assets
Assets are images, videos, and audio files or documents that you can attach to a content item.
{
"items": [
{
"id": "bac0aa60-dfa3-4f4e-9261-35a4fc693a76",
"created_on": "2022-11-23T12:50:33+00:00",
"changed_on": "2022-11-23T12:50:33+00:00",
"label": "Photo",
"name": "bg-cta-1",
"body": null,
"author": null,
"status": null,
"replaceable": true,
"reference_id": null,
"width": 1919,
"height": 939,
"extension": "png",
"original_name": "bg-cta-1",
"mime_type": "image/png"
}
],
"label": "Asset"
}
// Please note, you can only refer to an "id" of the already existing asset. Thus, make sure to upload it to Prepr in advance.
{
"label": "Asset",
"items": [
{
"id": "d7261363-a656-4b8e-bc39-506e6d6ab365"
}
]
}
argument | type | required | description |
---|---|---|---|
items | Object | true | Defines the asset object. |
items.*.id | String | true | Defines the asset id. |
items.*.label | String | true | Defines the type of the asset. |
items.*.caption | String | false | Defines caption of the asset. |
items.*.alignment | String | false | Defines alignment of the asset. Options: left , center , right |
label | String | false | Label Asset , is required in Dynamic content field (i.e., ElementBox) |
Resizing
For resizing cdn_files on-the-fly we advise you to read our full guide about resizing.
Integer
Integers are whole number, and are often used to store stock quantities, prices in cents, ect.
{
"id": "e356b423-71bc-40b5-8b6b-0611108658be",
"created_on": "2023-03-14T16:34:16+00:00",
"changed_on": null,
"label": "Integer",
"value": 122
}
{
"value" : 122
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
value | String | true | Defines the value of the integer |
Float
Float types are fields in which you can make number entries with decimal places, for accurate calculation such as the price of an item, distance, or weight.
{
"id": "69f6f04b-719e-49fd-b80c-b0037f495a31",
"created_on": "2023-03-14T16:34:16+00:00",
"changed_on": null,
"label": "Float",
"value": 122.12
}
{
"value" : 122.12
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
value | String | true | Defines the value of the float |
Boolean
The Booolean field lets you show an option that can only have one of two possible values: true or false. This field can only be added within a component.
{
"id": "4d32c2f1-69cd-4280-abe1-f5e548584417",
"created_on": "2023-03-09T09:45:23+00:00",
"changed_on": null,
"label": "Boolean",
"value": true
}
{
"value" : true
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
value | Boolean | true | Whether the boolean needs to be true or false. |
Stack
The Stack field stores a list of (personalized) models/components. This is a powerful type that allows you to create a site using the Stack field as your page builder.
Note
The API currently ignores the validation to check the maximum limit of items in the stack when creating a content item.
{
"items": [
{
"id": "4c0622c1-f635-4a0a-83de-8f56bc5b9ea4",
"created_on": "2023-03-17T10:07:30+00:00",
"changed_on": "2023-03-17T10:07:30+00:00",
"label": "Publication",
"read_time": {
"en-GB": 1
},
"publish_on": {
"en-GB": "2023-03-17T10:07:00+00:00"
}
},
{
"items": {
"description": {
"id": "006e3c8e-ea6b-44bd-886d-abcdf5357b6a",
"created_on": "2023-03-17T10:11:43+00:00",
"changed_on": null,
"label": "Text",
"body": "As far back as I can remember, I've always eaten french toast. It was usually a quick Sunday morning breakfast instead of pancakes or the go-to snack to use up the last stale bread slices. This is one of the easiest recipes that you can find for a quick treat.",
"format": null
},
"social_media_image": {
"items": [
{
"id": "54bbbdda-470b-4048-9a9e-0b3bca205003",
"created_on": "2023-03-09T14:16:39+00:00",
"changed_on": "2023-03-09T14:16:47+00:00",
"label": "Photo",
"name": "French toast",
"body": null,
"author": null,
"status": null,
"replaceable": true,
"reference_id": null,
"width": 3024,
"height": 4032,
"extension": "jpg",
"original_name": "4tq8iogbqhfi-pexels-sean-stevens-4623075",
"mime_type": "image/jpeg"
}
],
"label": "Asset"
},
"title": {
"id": "9a087714-324c-41cb-96c6-212f410cdf74",
"created_on": "2023-03-17T10:11:43+00:00",
"changed_on": null,
"label": "Text",
"body": "Excuse my french toast",
"format": null
}
},
"id": "1f3dec32-96e1-410a-bda8-22a634f9fd26",
"label": "PublicationElement"
}
]
}
// An example request to create a stack field with both content references and components:
{
"items": [
{
"items": {
"description": {
"body": "Say quiche!"
},
"title": {
"body": "Whether it's for a brunch, dinner or tea party, quiche is the perfect addition and can be extremely easy to prepare and customize to suit your and your guests' taste buds."
}
},
"id": "ad923fa7-a171-4bce-946c-30ca3e4bb98e"
},
{
"id": "eca7c865-f58b-459f-ab2b-c6d48f862d66"
}
]
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
items.*.id | String | true | ID of the content item you want to reference. |
items.*.items | Object | true | Defines the component fields object. |
Content Reference
The Content reference field stores a relation between one or more models. This powerful type allows you for example to create relationships between Posts and a Category or Posts and Author models.
{
"items": [
{
"id": "a69bebd0-b438-41ab-8fc8-86353afaf57e",
"created_on": "2023-01-27T10:35:52+00:00",
"changed_on": "2023-01-30T08:43:51+00:00",
"label": "Publication",
"read_time": {
"en-GB": 1
},
"publish_on": {
"en-GB": "2023-01-27T10:35:00+00:00"
}
}
],
"label": "Publication"
}
{
"items": [
{
"id": "987ca66d-22b3-45e2-beca-2cfa4d8309e3"
}
]
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
items.*.id | String | true | ID of the content item you want to reference. |
Component
Components are often used to represent a set of reusable fields. Also, it can be added as a custom element to the Dynamic content or Stack fields.
// A component returns an object of items, as well as a label and id.
{
"items": {
"{{items}}"
},
"label": "PublicationElement",
"id": "521c159f-c4f6-4d22-b1a4-b948e143160f"
}
// Example
// In this example we have a SEO component which consists of two fields. Meta title and meta description.
// The response would look something like this:
{
"items": {
"meta_description": {
"id": "c9c8e041-7945-43a5-821b-16aab773bab0",
"created_on": "2023-03-13T11:58:50+00:00",
"changed_on": null,
"label": "Text",
"body": "When you think of the Dutch appelbol, you think of a famous bakery in Utrecht. There you find them baked to perfection. A round crispy pastry and with every bite you taste a soft, but not too mushy, sweet baked apple on the inside filled with a delicious sweet gooey centre. It's a lot easier to make than it looks!",
"format": null
},
"meta_title": {
"id": "6fd27f3d-c18d-4c73-bc3d-bc5f03794301",
"created_on": "2023-03-13T11:58:50+00:00",
"changed_on": null,
"label": "Text",
"body": "As easy as appelbol",
"format": null
}
},
"label": "PublicationElement",
"id": "53bffbe6-3af8-4d66-ac8a-dc22e4ad785a"
}
{
"label": "PublicationElement",
"id": "6435498e-8d83-4fe2-b8ff-e0c661bf048f",
"items": {
"{{api_id}}": {
... // For a specification of the fields, see the relevant Field types.
}
}
}
// Example
// In this example we have an Article content model that has a SEO component with the api_id of `seo` including two fields - meta title with the api_id of `title` and meta description with the api_id of `description`.
// The Post example would look like this:
{
"locales": [
...
],
"model": {
...
},
"status": {
...
},
...,
...,
...,
"items": {
"{{locale}}": {
"seo": {
"label": "PublicationElement",
"id": "e145688a-bef6-43fd-8c7f-d181c431dae9",
"items": {
"title": {
"body": "The easiest french toast recipe",
"label": "Text"
},
"description": {
"body": "An easy french toast recipe",
"label": "Text"
}
}
},
...
}
},
...,
...
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
label | String | true | Label PublicationElement, is only required inside a Dynamic Content Editor. |
id | String | true | Defines the id of the component and is only required inside a Dynamic Content Editor |
items | String | true | Should contain all values of sub-fields that are defined in your component. |
Remote content
The Remote content field allows you to reference content in an external CMS, legacy system of eCommerce platform. It allows an editor to easily add items to content items. Check out the Content Integration setup guide to quickly setup your first integration.
{
"items": [
{
"id": "1",
"body": "Pizza slicer",
"description": "This handy tool has more uses than you may realize. It can be used to slice your pizza and shape dough for the perfect pies.",
"image_url": "https://prepr-example-show-content-demo-patterns.stream.prepr.io/w_1920,h_1080/4frprlq6w4k6-pizza-slicer.png",
"data": {
"sku_id": 1,
"price": 1299,
"stock": 5
},
"content_integration": {
"id": "62cc3bec-6978-4ba6-a699-d379ff0a93de"
}
}
],
"label": "ContentIntegrationItem"
}
{
"items": [
{
"id": "2",
"body": "Spatula",
"description": "We're willing to bet you reach for your spatula more often than you think. This tool is ideal for flipping the perfect pancake",
"image_url": "https://prepr-example-show-content-demo-patterns.stream.prepr.io/w_1920,h_1080/2qanpdxyhf20-spatula.png",
"content_integration": {
"id": "c0263fe3-007e-4307-9792-7364f6c0cf06"
}
}
],
"label": "ContentIntegrationItem"
}
Content integration items in Prepr have a predefined schema. This means that the type for any content integration item in the REST API schema follows the definition below:
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
id | String | true | Defines the id of the object. |
content_integration.id | String | true | Defines the id of the content integration. |
body | String | true | Defines the body of the object. |
description | String | true | Defines the description of the object. |
image_url | String | true | Defines the image URL of the object. |
external_url | String | false | Defines the external URL of the object. |
data | Object | false | Defines a list of key values. |
Note
Key Value data can be passed from the connected API to Prepr. If a new version of an item is available in the Content Integration response Prepr is able to automatically update the version of the item in the content item response.
Date & Time
The DateTime field adheres to ISO 8601 standard. In the field settings, you can choose to allow extra dates and time selection (hours and minutes) and also have either 1 or multiple dates.
For example, if you have no time enabled, the format would be as follows:
"format": "Y-m-d"
and "value": "2023-01-01"
.
If you have enabled the option to allow time selection, it would look like this: "format": "Y-m-d H:i:s"
and "value": "2023-01-01 18:25:00"
.
// Single date
{
"id": "73fd5c62-78b4-434a-966b-4aba04f3648a",
"created_on": "2023-01-01T16:25:53+00:00",
"changed_on": null,
"label": "DateTime",
"value": "2023-01-01",
"format": "Y-m-d"
}
// With time selection enabled
{
"id": "c1c5c7cf-d737-4fd9-9949-940b84cbf454",
"created_on": "2023-01-01T16:28:21+00:00",
"changed_on": null,
"label": "DateTime",
"value": "2023-01-01 18:25:00",
"format": "Y-m-d H:i:s"
}
// Multiple dates
{
"items": [
{
"id": "7477b1ac-2958-4764-9cf7-c8d5e20f77cb",
"created_on": "2023-01-01T16:28:21+00:00",
"changed_on": null,
"label": "DateTime",
"value": "2023-01-01",
"format": "Y-m-d"
},
...
],
"label": "DateTime"
}
// Single date
{
"label": "DateTime",
"format": "Y-m-d",
"value": "2023-01-01"
}
// With time selection enabled
{
"label": "DateTime",
"format": "Y-m-d H:i:s",
"value": "2020-10-19 12:00:00"
}
// Multiple dates
{
"label": "DateTime",
"items": [
{
"format": "Y-m-d",
"value": "2023-01-01"
},
...,
...,
]
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
format | String | true | Defines the format of the date. |
value | String | true | Defines the value of the date. |
label | String | true | Label DateTime. |
items | Array | true | Defines date elements. |
items.*.format | String | true | Defines the format of the date. |
items.*.value | String | true | Defines the value of the date. |
Date & Time range
The DateTimeRange field adheres to ISO 8601 standard. In the field settings, you can choose to allow extra date ranges and time selection (hours and minutes) and also have either 1 or multiple date ranges.
For example, if you have no time enabled, the format would be as follows:
"format": "Y-m-d"
and "value": "2023-01-01"
.
If you have enabled the option to allow time selection, it would look like this: "format": "Y-m-d H:i:s"
and "value": "2023-01-01 18:25:00"
.
// Single date range
{
"id": "abb46555-013f-4e2e-871e-344b243332f6",
"created_on": "2023-01-01T16:25:53+00:00",
"changed_on": null,
"label": "DateTimeRange",
"from": "2023-01-01",
"until": "2024-12-31",
"format": "Y-m-d"
}
// With time selection enabled
{
"id": "efd799d9-ee9d-4ec1-8cc3-487b1ecb347a",
"created_on": "2023-01-01T16:25:53+00:00",
"changed_on": null,
"label": "DateTimeRange",
"from": "2023-01-01 00:00:00",
"until": "2024-12-31 23:59:59",
"format": "Y-m-d H:i:s"
}
// Multiple date ranges
// Time selection is also possible when you have multiple dates
{
"items": [
{
"id": "2d701a86-7867-479a-bf09-36dbd847a36f",
"created_on": "2023-01-01T16:28:21+00:00",
"changed_on": null,
"label": "DateTimeRange",
"from": "2023-01-01",
"until": "2024-12-31",
"format": "Y-m-d"
},
{
"id": "72df271a-ebda-4372-b1ab-9d5ca36ef585",
"created_on": "2023-06-01T16:28:21+00:00",
"changed_on": null,
"label": "DateTimeRange",
"from": "2023-06-01",
"until": "2023-12-31",
"format": "Y-m-d"
},
...
],
"label": "DateTimeRange"
}
// Single date range
{
"label": "DateTimeRange",
"format": "Y-m-d",
"from": "2023-01-01",
"until": "2024-12-31"
}
// With time selection enabled
{
"label": "DateTimeRange",
"format": "Y-m-d H:i:s",
"from": "2023-01-01 00:00:00",
"until": "2024-12-31 23:59:59"
}
// Multiple date ranges
// Time selection is also possible when you have multiple dates
{
"label": "DateTimeRange",
"items": [
{
"format": "Y-m-d H:i:s",
"from": "2023-01-01 00:00:00",
"until": "2024-12-31 23:59:59"
},
...,
...,
]
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
format | String | true | Defines the format of the date. |
from | String | true | Defines the from date. |
until | String | true | Defines the until date |
label | String | true | Label DateTime. |
items | Array | true | Defines date elements. |
items.*.from | String | true | Defines the from date. |
items.*.until | String | true | Defines the until date. |
items.*.value | String | true | Defines the value of the date. |
Location
The Location field allows content editors to add Google Maps geo-points (coordinates or an address) to your content item.
{
"id": "18e6f038-7766-4c65-8ef0-89e1c6a32926",
"created_on": "2023-01-01T16:05:08+00:00",
"changed_on": null,
"label": "Coordinates",
"latitude": 21.3137,
"longitude": -157.806
}
{
"latitude": "21.3137",
"longitude": "-157.806",
"label" : "Coordinates"
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
latitude | String | true | Defines the latitude. |
longitude | String | true | Defines the longitude. |
label | String | false | Label Coordinates, is required in Dynamic content field (i.e.,ElementBox) and component (i.e., PublicationElement). |
Business Hours
The Business Hours field represents the time periods that this location is open for business. Holds a collection of BusinessHoursPeriod instances.
{
"items": [
{
"id": "50425271-b86c-4d0a-886e-988642808d77",
"created_on": "2023-03-13T10:59:21+00:00",
"changed_on": null,
"label": "BusinessHours",
"state": "open",
"open_day": 1,
"open_time": "00:00",
"close_day": 2,
"close_time": "00:00",
"valid_from": null,
"valid_until": null
},
{
"id": "c9509f72-e277-49e1-bbc5-2a31df543cae",
"created_on": "2023-03-13T10:59:21+00:00",
"changed_on": null,
"label": "BusinessHours",
"state": "open",
"open_day": 2,
"open_time": "04:30",
"close_day": 3,
"close_time": "01:30",
"valid_from": null,
"valid_until": null
},
{
"id": "9b602eb5-e376-4965-9837-d604350d0724",
"created_on": "2023-03-13T10:59:21+00:00",
"changed_on": null,
"label": "BusinessHours",
"state": "open",
"open_day": 2,
"open_time": "01:30",
"close_day": 2,
"close_time": "02:00",
"valid_from": null,
"valid_until": null
}
],
"label": "BusinessHours"
}
{
"items" : [
{
"open_day" : 2,
"open_time" : "08:00",
"close_day" : 2,
"close_time" : "19:00",
"valid_from" : "2023-03-09",
"valid_until" : "2023-03-12"
}
]
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
item | Array | true | Defines the business hour items. |
Days are defined as 1 through 7, starting on Monday. So Monday would be 1, Tuesday would be 2, and so on.
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
open_day | Int | true | 1, 2, 3, 4, 5, 6, 7 are allowed. |
open_time | String | true | 00:00 to 23:59 are allowed. |
close_day | Int | true | 1, 2, 3, 4, 5, 6, 7 are allowed. |
close_time | String | true | 00:00 to 23:59 are allowed. |
valid_from | String | false | YYYY-MM-DD |
valid_until | String | false | YYYY-MM-DD |
Tip
The Business hours field can only be used by adding the Date & Time field to your model and setting the type to Business hours
.
Resource
The Resource field allows you to link to an internal or external webpage and can be added to a component as a field. This field can can only be used within a component.
{
"id": "87d97825-5072-4ee0-a0c3-d19a7070ee0a",
"created_on": "2023-03-14T16:54:50+00:00",
"changed_on": null,
"label": "Resource",
"body": "Fall Bake-a-thon",
"url": "https://patterns.prepr.io/livestream/live/fall-bake-a-thon",
"type": "Webpage"
}
{
"url" : "https://patterns.prepr.io/livestream/live/fall-bake-a-thon",
"type" : "Webpage",
"body" : "Fall Bake-a-thon",
"label" : "Resource"
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
url | String | true | Defines the url of the resource. |
type | String | true | Defines the type of the resource. Options: Webpage, Audio, Video, Document, Other. |
body | String | false | Optional name of the resource page. |
label | String | false | Label Resource, is required is required in a component (i.e., PublicationElement). |
Social
The Social field allows embed social posts into content items by adding a a social URL.
{
"id": "fe556b3f-20a1-416d-a6c7-baa7ccf29ead",
"created_on": "2023-01-01T10:04:57+00:00",
"changed_on": null,
"label": "TwitterPost",
"url": "https://twitter.com/SpaceX/status/1633941127081652224?s=20"
}
{
"url" : "https://twitter.com/SpaceX/status/1633941127081652224?s=20",
"label" : "TwitterPost"
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
url | String | true | Defines the url of the social post. |
label | String | true | TwitterPost, InstagramPost, YouTubePost, FacebookPost, VimeoPost, SoundCloudPost, SpotifyPlaylist, TikTokPost, ApplePodcast. |
Color
The Color field is made up of HEX code.
{
"id": "3035280e-c171-42cd-a643-c1fee2083543",
"created_on": "2023-03-13T11:49:58+00:00",
"changed_on": null,
"label": "Color",
"body": "#c73434",
"format": "Color"
}
{
"body" : "#003366"
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
body | String | true | Defines the color (using Hex). |
Tag
The Tag field allows content editors to add tags, keywords to your content item.
// The Tag field returns an array of tag items:
{
"items": [
{
"id": "7ca6249b-7b63-4f96-a090-c92b5c297a11",
"created_on": "2023-03-09T09:45:23+00:00",
"changed_on": null,
"label": "Tag",
"body": "awesome",
"slug": "awesome"
},
...,
...
],
"label": "Tag"
}
{
"items": [
{
"label": "Tag",
"body": "awesome",
},
],
"label": "Tag"
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
items | Array | true | Defines the tags array. |
items.*.body | String | true | Defines the body of the tag. |
items.*.id | String | false | Defines the id of the tag, is optional. You need to have either items.*.body or items.*.id . |
items.*.label | String | false | Label Tag. |
label | String | false | Label Tag. |
Quote (deprecated)
{
"id": "abe18b2d-3399-4181-8436-dee27f9e27ed",
"created_on": "2019-01-09T20:52:49+00:00",
"changed_on": null,
"label": "Quote",
"body": "If we knew what it was we were doing, it would not be called research, would it?",
"author": "Albert Einstein"
}
{
"author" : "Albert Einstein",
"body" : "If we knew what it was we were doing, it would not be called research, would it?",
"label" : "Quote"
}
ARGUMENT | TYPE | REQUIRED | DESCRIPTION |
---|---|---|---|
body | String | true | Defines the body of the quote. |
author | String | true | Defines the author of the quote. |
label | String | false | Label Quote, is required in Dynamic content field (i.e.,ElementBox) |