About this Guide
This article contains a glossary of Ceros SDK page-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.
disable()
called on: CerosPage
or CerosPageCollection
arguments: none
Disables the page(s) in the Ceros experience. When a page is disabled, it will not be able to be navigated to. If the page is the current page the user is viewing, or if the page is already disabled, the command will do nothing.
var thePage = experience.findPagesByTag('page-to-disable');
thePage.disable();
enable()
called on: CerosPage
or CerosPageCollection
arguments: none
Enables the page(s) in the Ceros experience. If the page is already enabled, the command will do nothing.
var thePage = experience.findPagesByTag('page-to-enable');
thePage.enable();
findAllLayers()
called on: CerosPage
arguments: none
Returns a CerosLayerCollection
containing all the layers in the page.
var myPage = experience.getCurrentPage();
var layers = myPage.findAllLayers();
layers.show(); //shows all layers on current page
findAllSyncedObjects()
called on: CerosPage
arguments: none
Returns a CerosSyncedObjectCollection
containing all the syncedObjects in the page.
var myPage = experience.getCurrentPage();
var syncedObjects = myPage.findAllSyncedObjects();
syncedObjects.show(); //shows all syncedObjects on current page
getPageState()
called on: CerosPage
arguments: none
Returns a CerosSDK.PAGESTATE
constant representing the current state of the page. The return value will be one of:
CerosSDK.PAGESTATE.ENABLED
– the page is loaded and enabledCerosSDK.PAGESTATE.DISABLED
– the page is loaded but has been disabled in the experience
if (myPage.getPageState() === CerosSDK.PAGESTATE.DISABLED){
myPage.enable();
}
startAnimations()
called on: CerosPage
arguments: none
Starts all entry animations on the page. If the animation is already animating it will be restarted from the beginning.
experience.getCurrentPage().startAnimations();
pauseAnimations()
called on: CerosPage
arguments: none
Pauses all entry animations on the page.
experience.getCurrentPage().pauseAnimations();
getPayload()
called on: CerosPage
arguments: none
Retrieves the payload for the page, if you have configured one in the Studio. If there is not a payload configured, this will return undefined
.
var myPayload = experience.getCurrentPage().getPayload();
getTags()
called on: CerosPage
arguments: none
Retrieves the tags for the page, if you have tagged it with any in the Studio. If the page has not been tagged, then an empty array is returned.
var tags = experience.getCurrentPage().getTags();
getWidth()
called on: CerosPage
arguments: none
Retrieves the width of the page as configured in the Studio.
var pageWidth = experience.getCurrentPage().getWidth();
getHeight()
called on: CerosPage
arguments: none
Retrieves the height of the page as configured in the Studio.
var pageHeight = experience.getCurrentPage().getHeight();
getPageNumber()
called on: CerosPage
arguments: none
Retrieves the 1-based index of the page as configured in the Studio.
var currentPageNumber = experience.getCurrentPage().getPageNumber();
findAllComponents()
called on: CerosPage or CerosPageCollection
arguments: none
Retrieves a CerosComponentCollection containing all the components on the CerosPage or pages inside the CerosPageCollection.
var components = experience.findPagesByTag('my-page-tag').findAllComponents();