Ana içeriğe geç

getSlides

Get the block's slides tree as a flat pre-order array (slider_block only).

Description

This method returns the slides of a slider block as a flat, pre-order array - each item carries its depth and parentId, so you can rebuild the tree on the client. It works only for blocks of type slider_block. It returns a Promise that resolves to an IBlockSlidesResponse object.

Blocks.getSlides(

marker*

);

Parameters schema

Schema

marker(required): string
Block marker
example: "slider_block"

Examples

Minimal example

const response = await Blocks.getSlides('slider_block');

Example response

{
"total": 3,
"time": 5,
"timeInterval": "sec",
"items": [
{
"id": 1,
"parentId": null,
"depth": 0,
"position": 1,
"visible": true,
"time": 5,
"timeInterval": "sec",
"attributeValues": {}
},
{
"id": 2,
"parentId": 1,
"depth": 1,
"position": 1,
"visible": true,
"attributeValues": {}
}
]
}

Response schema

Schema: IBlockSlidesResponse

total: number
Total number of slides.
example: 3

time: number
Default display time for slides.
example: 5

timeInterval: 'sec' | 'ms'
Unit of the time field.
example: "sec"

items: IBlockSlideItem[]
Flat pre-order array of slide items.

items.id: number
Slide identifier.
example: 1

items.parentId: number | null
Parent slide identifier, or null for root slides.
example: null

items.depth: number
Depth of the slide in the tree.
example: 0

items.position: number
Position of the slide among its siblings.
example: 1

items.visible: boolean
Whether the slide is visible.
example: true

items.time: number
Display time for the slide.
example: 5

items.timeInterval: 'sec' | 'ms'
Unit of the time field.
example: "sec"

items.attributeValues: IAttributeValues
Map of attribute values keyed by marker.