Difference between revisions of "Content Item Object"

From MSX - Wiki
Jump to navigation Jump to search
Line 65: Line 65:
  
 
* <code>"default"</code>: Default item.
 
* <code>"default"</code>: Default item.
* <code>"teaser"</code>: Teaser items are similar to "default" items, but they have a larger title.
+
* <code>"teaser"</code>: Teaser items are similar to <code>"default"</code> items, but they have a larger title.
 
* <code>"button"</code>: Button items have a frame and a transparent background color. The icon and label properties are typically used with this type.
 
* <code>"button"</code>: Button items have a frame and a transparent background color. The icon and label properties are typically used with this type.
 
* <code>"separate"</code>: Separate items have seperated titles.
 
* <code>"separate"</code>: Separate items have seperated titles.

Revision as of 10:28, 18 January 2021

{   
    "id": "content_item_id",    
    "type": "default",
    "key": "red",
    "layout": "0,0,1,1",
    "area": "0,0,12,6",
    "offset": "0,0,0,0",
    "display": true,
    "enable": true,
    "focus": false,
    "execute": false,    
    "enumerate": false,
    "compress": true,
    "group": "Item Group",
    "color": "msx-glass",
    "title": "Item Title",
    "titleHeader": "Item Title Header",
    "titleFooter": "Item Title Footer",
    "label": "Item Label",
    "icon": "blank",
    "iconSize": "medium",
    "headline": "Item Headline",
    "text": "Item Text",   
    "alignment": "left",
    "tag": "Item Tag",
    "tagColor": "msx-red",
    "badge": "Item Badge",
    "badgeColor": "msx-green",
    "progress": -1,
    "progressColor": "msx-yellow",
    "wrapperColor": "msx-blue",
    "image": "http://link.to.image",
    "imageFiller": "default",
    "imageWidth": -1,
    "imageHeight": -1,
    "imageOverlay": -1,
    "imagePreload": false,
    "imageLabel": "Image Label",
    "imageColor": "msx-black",
    "imageScreenFiller": "fit",      
    "playerLabel": "Player Label",
    "background": "http://link.to.image",    
    "extensionIcon": "blank",
    "extensionLabel": "Extension Label",
    "action": null,
    "data": null,
    "properties": null,
    "live": null,
    "selection": null,
    "options": null
}
Property syntax of content item object
Property Type Default Value Mandatory Since Version Description
id string null No 0.1.0

The ID of the content item. This property can be used to identify the item. The ID must be unique and only consist of letters, numbers, and the special characters "_", "-", ".".

type string "default" No 0.1.0

The type of the content item.

  • "default": Default item.
  • "teaser": Teaser items are similar to "default" items, but they have a larger title.
  • "button": Button items have a frame and a transparent background color. The icon and label properties are typically used with this type.
  • "separate": Separate items have seperated titles.
  • "space": Space items are not selectable and can be used to add background or foreground items.
  • "control": Control items are similar to "button" items and mainly designed for internal purposes (e.g. they are used in context menus and settings). The icon and label properties are typically used with this type. Additionally, the extensionLabel and extensionIcon properties are available for this type.
key string null No 0.1.97

The key that is used to assign a keyboard key to the content item action. This property is part of the hidden features. For more information, please see Key Property.

layout string null Only for the template object and non-templated items 0.1.0

The layout of the content item in format "x,y,w,h". This property is used to position the item on the layout grid.

Note: The grid size is 12x6 (or 8x6 for panels). It is not possible to register multiple items on the same position, however, it is possible to overlap items (e.g. to add background or foreground items of type "space"). If this property is set to the template object, only the w and h values are used. This property has no effect if it is set to a templated item.

The x value can go from 0 to 11 (or from 0 to 7 for panels).
The y value can go from 0 to 5.
The w value can go from 1 to 12 (or from 1 to 8 for panels).
The h value can go from 1 to 6.

All values are absolute integers. Please use the offset property to position items between the grid.

area string null No 0.1.110

The area used for created content items in the format "x,y,w,h". This property can only be used inside the template object and is used to specify the area in which the created items can be positioned. It is typically used with an overlay/underlay page to keep a specific area clear of content.

The x value can go from 0 to 11 (or from 0 to 7 for panels).
The y value can go from 0 to 5.
The w value can go from 1 to 12 (or from 1 to 8 for panels).
The h value can go from 1 to 6.

All values are absolute integers.

Note: If this property is set, the possible w and h values of the layout property are changed accordingly.

offset string null No 0.1.0

The offset of the content item in format "x,y,w,h". This property can be used to add or subtract an offset.

The x value can go from -11.0 to 11.0 (or from -7.0 to 7.0 for panels).
The y value can go from -5.0 to 5.0.
The w value can go from -11.0 to 11.0 (or from -7.0 to 7.0 for panels).
The h value can go from -5.0 to 5.0.

All values are relative floating point numbers.

Note: The offset values have been increased in version 0.1.110. In previous versions, each value can only go from -1.0 to 1.0.

display boolean true No 0.1.0

Indicates if the content item is displayed. This property can be used to temporarily remove items.

enable boolean true No 0.1.0

Indicates if the content item is enabled. This property can be used to temporarily disable items.

focus boolean false No 0.1.0

Indicates if the content item is focused. This property can be used to set the focus to a specific item.

Note: If this property is set to true for multiple items, only the first item will get the focus. This property has no effect if the content is loaded via a menu.

execute boolean false No 0.1.0

Indicates if the content item is automatically executed it on load. This property is part of the hidden features. For more information, please see Execute Property.

enumerate boolean true|false No 0.1.0

Indicates if the content item is enumerated. Enumerated items can be executed in a row (e.g. to start a playlist or a slideshow). The default value is true if the item is automatically created (via the template object), otherwise false.

compress boolean true No 0.1.123

Indicates if font size adjustments are performed when the content is compressed.

Note: This property is ignored if the content root object has not set the compress property to true.

This property is part of the hidden features. For more information, please see Compress Property.

group string null No 0.1.92

The group label of the content item if it is enumerated. This label is shown in the content headline after the enumeration info. If the group label starts with the string "id:" (e.g. "id:group_id"), the label is only used as ID and does not appear in the content headline.

Note: Each group has its own enumeration counter. Therefore, if a group item is executed, only the related group items are executed in a row. To use this property, the enumerate property must be set to true, otherwise this property is ignored.

This property supports inline expressions. For more information, please see Inline Expressions.

color string null No 0.1.0

The background color of the content item. Please see Colors for possible values.

title string null No 0.1.0

The title of the content item that is positioned in the lower left corner.

Note: Since version 0.1.82, you can change the alignment of this content with the alignment property.

This property supports inline expressions. For more information, please see Inline Expressions.

titleHeader string null No 0.1.0

The title header of the content item that is positioned in the lower left corner.

Note: Since version 0.1.82, you can change the alignment of this content with the alignment property.

This property supports inline expressions. For more information, please see Inline Expressions.

titleFooter string null No 0.1.0

The title footer of the content item that is positioned in the lower left corner.

Note: Since version 0.1.82, you can change the alignment of this content with the alignment property.

This property supports inline expressions. For more information, please see Inline Expressions.

label string null No 0.1.0

The label of the content item that is positioned in the bottom center or on the left side if the item type is "control". This property is typically used for items of type "button" or "control". This property supports inline expressions. For more information, please see Inline Expressions.

icon string null No 0.1.0

The icon of the content item that is positioned in the center or on the left side if the item type is "control". This property is typically used for items of type "button" or "control". Please see Icons for possible values.

iconSize string "medium" No 0.1.0

The size of the content icon.

  • "small": Small size.
  • "medium": Medium size.
  • "large": Large size.
  • "extra-large": Extra-large size.
headline string null No 0.1.0

The headline of the content item that is positioned in the upper left corner.

Note: Since version 0.1.82, you can change the alignment of this content with the alignment property.

This property supports inline expressions. For more information, please see Inline Expressions.

text string|array null No 0.1.0

The text of the content item that is positioned in the upper left corner. By default, the text is indicated as single string. Additionally, longer texts can be split into an array of strings.

Note: Since version 0.1.82, you can change the alignment of this content with the alignment property.

This property supports inline expressions. For more information, please see Inline Expressions.

alignment string "left" No 0.1.82

The content alignment of the properties title, titleHeader, titleFooter, headline, and text. By default, the content of these properties are aligned on the left side.

  • "left": The content is aligned on the left side.
  • "center": The content is aligned in the center.
  • "right": The content is aligned on the right side.
  • "justify": The content is aligned to fill the entire size.

Since version 0.1.97, you can also set separate alignments for the title (i.e. title, titleHeader, and titleFooter) and text (i.e. headline and text) properties.

  • "title-left": The title properties are aligned on the left side.
  • "title-center": The title properties are aligned in the center.
  • "title-right": The title properties are aligned on the right side.
  • "title-justify": The title properties are aligned to fill the entire size.
  • "text-left": The text properties are aligned on the left side.
  • "text-center": The text properties are aligned in the center.
  • "text-right": The text properties are aligned on the right side.
  • "text-justify": The text properties are aligned to fill the entire size.
  • "title-{ALIGNMENT}|text-{ALIGNMENT}": The title and text properties are aligned differently. The {ALIGNMENT} part must be replaced with the value left, center, right, or justify.
tag string null No 0.1.0

The tag of the content item that is positioned in the upper right corner. This property supports inline expressions. For more information, please see Inline Expressions.

tagColor string null No 0.1.0

The background color of the content tag. Please see Colors for possible values.

badge string null No 0.1.0

The badge of the content item that is positioned in the upper left corner. This property supports inline expressions. For more information, please see Inline Expressions.

badgeColor string null No 0.1.0

The background color of the content badge. Please see Colors for possible values.

progress number -1 No 0.1.70

The progress of the content item that is shown as bar at the bottom. The value is a relative floating point number and can go from 0.0 to 1.0. If this property is set to -1, the progress bar is not visible, but can be updated. If this property is not set at all, the progress bar is not visible and can not be updated.

progressColor string null No 0.1.70

The color of the progress bar. Please see Colors for possible values.

wrapperColor string null No 0.1.70

The color of the content wrapper (e.g. the color of the image space within the content item). To use this property, the content must be wrapped (e.g. the imageWidth or imageHeight property is set), otherwise this property is ignored. Please see Colors for possible values.

image string null No 0.1.0

The image of the content item. The properties imageFiller, imageWidth, and imageHeight can be used to style and position the image.

imageFiller string "default" No 0.1.0

The filler type of the content image.

  • "default": The image is stretched to fill the entire size.
  • "width"|"width-top": The image is sized to fill the entire width (by keeping the ratio) and is positioned at the top.
  • "width-center": The image is sized to fill the entire width (by keeping the ratio) and is positioned in the center.
  • "width-bottom": The image is sized to fill the entire width (by keeping the ratio) and is positioned at the bottom.
  • "height"|"height-left": The image is sized to fill the entire height (by keeping the ratio) and is positioned on the left side.
  • "height-center": The image is sized to fill the entire height (by keeping the ratio) and is positioned in the center.
  • "height-right": The image is sized to fill the entire height (by keeping the ratio) and is positioned on the right side.
  • "fit": The image is sized (by keeping the ratio) to fit into the size and is positioned in the center.
  • "cover": The image is sized (by keeping the ratio) to cover the entire size and is positioned in the center.
  • "smart": If the ratio of the image and the size is the same, "cover" is used, otherwise "fit" is used.
imageWidth number -1 No 0.1.0

The width of the content image. This property can be used to reduce the width of the image and to position the text on the right side of it. The value is a relative floating point number and can go from 0.0 to 12.0 (or from 0.0 to 8.0 for panels). Additionally, the value must be less or equal than the item width, otherwise it is ignored.

imageHeight number -1 No 0.1.0

The height of the content image. This property can be used to reduce the height of the image. The value is a relative floating point number and can go from 0.0 to 6.0. Additionally, the value must be less or equal than the item height, otherwise it is ignored.

imageOverlay number -1 No 0.1.0

The overlay of the content image. This property can be used to explicitly set or remove the overlay of the image. The overlay is used to darken the lower part of the image to make the titles (i.e. title, titleHeader, and titleFooter) more visible. By default, the overlay is used if an image has titles on top of it.

  • -1: Automatically set/remove overlay.
  • 0: Remove overlay.
  • 1: Set overlay.

Since version 0.1.97, you can also set an inverted overlay to darken the upper part of the image to make the text (i.e. headline and text) more visible.

  • 2: Set inverted overlay and automatically set/remove default overlay.
  • 3: Set inverted overlay and remove default overlay.
  • 4: Set inverted and default overlay.
imagePreload boolean false No 0.1.58

Indicates if the content image is preloaded to make it directly visible. By default, images are loaded on the fly.

Note: For preloaded images, the imageFiller property can not be set to "fit", "cover", or "smart".

imageLabel string null No 0.1.0

The label of the content image that is used inside the slideshow. This property is only used if the content action is image:{URL} or image:context. This property supports inline expressions. For more information, please see Inline Expressions.

imageColor string null No 0.1.6

The background color of the content image that is used inside the slideshow. This property is only used if the content action is image:{URL} or image:context. Please see Colors for possible values.

imageScreenFiller string "fit" No 0.1.6

The filler type of the content image that is used inside the slideshow. This property is only used if the content action is image:{URL} or image:context. Please see property imageFiller for possible values.

playerLabel string null No 0.1.0

The label of the content video/audio file that is used inside the player. This property is only used if the content action is video:{URL} or audio:{URL}. This property supports inline expressions. For more information, please see Inline Expressions.

extensionIcon string null No 0.1.0

The extension icon. This property is only available for content items of type "control" and can be used to display an additional icon on the right side of the control item. Please see Icons for possible values.

extensionLabel string null No 0.1.0

The extension label. This property is only available for content items of type "control" and can be used to display an additional label on the right side of the control item. This property is only used if no extensionIcon is set. This property supports inline expressions. For more information, please see Inline Expressions.

action string null No 0.1.0

The action of the content item that is performed if the item is executed. If this property is not set and the item is executed, an info message with "No action available." is displayed. Please see Actions for possible values.

data object null No 0.1.0

The additional data of the content item that is used if the item is executed. Please see Actions for possible values.

properties object null No 0.1.58

Extended properties for special use cases. Each property is a key-value pair of type string. Please see Extended Properties for possible values.

live object null No 0.1.70

A special live object to periodically update content items (e.g. with live data, playback progress, etc.). Please see Live Object for the data structure.

selection object null No 0.1.110

A special selection object to specify the behavior of the content item if it is selected (i.e. if it has the focus). Please see Selection Object for the data structure.

options object null No 0.1.120

A special page object that is displayed in a panel if the content item is selected and the menu button is pressed. The availability of options for the current selected item is indicated in the lower right corner of the content screen. This property is ignored if the content is displayed in a panel. Please see Content Page Object for the data structure.

Related Hidden Features[edit]

See also[edit]