Skip to main content

Ceros SDK: Layer-level Commands Glossary

Daniel Isley avatar
Written by Daniel Isley
Updated over 2 weeks ago

About this Guide

This article contains a glossary of Ceros SDK layer-level commands to use when writing your own SDK code. Please note that all listed commands are as is, and we cannot guarantee all functionality to work across all experiences and devices.

findAllComponents()

called on: CerosLayer arguments: none

Returns a CerosComponentCollection containing the components in the CerosLayer.

var components = myLayer.findAllComponents(); components.click(); //clicks all components in the first layer

show()

called on: CerosLayer or CerosLayerCollection arguments: none

Makes the layer(s) visible. If this is called on a layer that is already visible, it will have no effect. Any entry animations configured on components in this layer will be triggered.

var myLayer = myExperience.findLayerById('a-layer-id'); myLayer.show();

hide()

called on: CerosLayer or CerosLayerCollection arguments: none

Hides the layer(s). If this is called on a layer that is already hidden, it will have no effect. Any exit animations configured on components in this layer will be triggered.

var myLayer = myExperience.findLayerById('a-layer-id'); myLayer.hide();

getPage()

called on: CerosLayer arguments: none

Retrieves the CerosPage that this layer belongs to.

var myPage = myExperience.findLayerById('a-layer-id').getPage();

getPayload()

called on: CerosLayer arguments: none

Retrieves the payload for the layer, if you have configured one in the Studio. If there is not a payload configured, this will return undefined.

var myPayload = myExperience.findLayerById('a-layer-id').getPayload();

getTags()

called on: CerosLayer arguments: none

Retrieves the tags for the layer, if you have tagged it with any in the Studio. If the layer has not been tagged, then an empty array is returned.

var tags = myExperience.findLayerById('a-layer-id').getTags();

isComponent()

called on: CerosLayer arguments: none

Returns true if the layer is a component or group

var myLayer = myExperience.findLayerById('a-layer-id'); if (myLayer.isComponent()) { myLayer.show(); }

isGroup()

called on: CerosLayer arguments: none

Returns true if the layer is a group

var myLayer = myExperience.findLayerById('a-layer-id'); if (myLayer.isGroup()) { myLayer.show(); }

isSyncedObject()

called on: CerosLayer arguments: none

Returns true if the layer is a synced object

var myLayer = myExperience.findLayerById('a-layer-id'); if (myLayer.isSyncedObject()) { myLayer.show(); }

isFolder()

called on: CerosLayer arguments: none

Returns true if the layer is a folder

var myLayer = myExperience.findLayerById('a-layer-id'); if (myLayer.isFolder()) { myLayer.show(); }

on(eventName, callback)

called on: CerosLayer or CerosLayerCollection arguments: eventName – The name of the event to subscribe to callback – The function to run when this event is received

merge(layerCollections)

called on: CerosLayerCollection arguments: layerCollections – An array of CerosLayerCollections to merge

Did this answer your question?