ConditionalSection
The object for defining conditional properties for a section component, and when the conditional properties are in effect.
Declaration
object ConditionalSectionProperties
| Name | Type | Description |
|---|---|---|
conditions Required | (Condition | [Condition]) | An instance or array of conditions that, when met, cause the conditional section component properties to take effect. |
allowAutoplacedAds | boolean | A Boolean value that allows the placement of ad banners between components. Nested components inherit the value of the outermost container that explicitly sets |
anchor | Anchor | An object that defines vertical alignment with another component. |
animation | (ComponentAnimation | string("none")) | An object that defines an animation to apply to the component. To remove a previously set condition, use |
behavior | (Behavior | string("none")) | An object that defines behavior for a component, like Parallax or Springy. To remove a previously set condition, use |
contentDisplay | (CollectionDisplay | HorizontalStackDisplay | string("none")) | An object that defines how to position child components within this To remove a previously set condition, use |
hidden | boolean | A Boolean value that determines whether the component is hidden. |
layout | (ComponentLayout | string) | An inline ComponentLayout object that contains layout information, or a string reference to a If you don’t define |
scene | (Scene | string("none")) | A set of animations applied to any header component that’s a child of this section. To remove a previously set condition, use |
style | (ComponentStyle | string | string("none")) | An inline ComponentStyle object that defines the appearance of this component, or a string reference to a To remove a previously set condition, use |
Discussion
Use the ConditionalSection object to define an array of conditional section properties and the conditions under which to apply them. When a condition is met, the value of a property in ConditionalSection overrides the value of the same property if defined in the parent Section component. See Section.
Example
{
"components": [
{
"role": "section",
"components": [
{
"role": "photo",
"URL": "bundle://header.jpg"
},
{
"role": "title",
"text": "Section Title Beneath Image"
}
],
"hidden": true,
"conditional": [
{
"hidden": false,
"conditions": [
{
"maxViewportWidth": 415
}
]
}
]
},
{
"role": "section",
"components": [
{
"role": "header",
"style": {
"fill": {
"type": "image",
"URL": "bundle://header.jpg"
}
},
"layout": {
"minimumHeight": "75cw"
},
"components": [
{
"role": "title",
"text": "Section Title Overlay",
"anchor": {
"targetAnchorPosition": "center"
}
}
]
}
],
"hidden": true,
"conditional": [
{
"hidden": false,
"conditions": [
{
"minViewportWidth": 416
}
]
}
]
}
]
}