Page information
page.getKind()
Retrieve the specific category of the page. This method determines the type of page from a set of predefined categories, providing more granular information about the page’s purpose and functionality.
Syntax
Returns
Promise<string
>
A promise that resolves to a string indicating the kind of the current page. The possible values are:
static
ecommerce
cms
userSystems
utility
staticTemplate
Example
Designer Ability
page.getName()
Retrieves the name of the page.
Syntax
Returns
Promise<string
>
A Promise that resolves to a string with the page name.
Example
Designer Ability
page.setName(name)
Sets the name of the page to the provided value.
Syntax
Parameters
- name:
string
- The new name to set for the page.
Returns
Promise<null
>
A Promise that resolves to null
when the page name is set.
Example
Designer Ability
page.getSlug()
Retrieves the slug of the page.
Syntax
Returns
Promise<string
>
A Promise that resolves to a string with the page slug.
Example
Designer Ability
page.setSlug(slug)
Sets the slug of the page to the provided value.
Syntax
Parameters
- slug:
string
- The new name to set for the page.
Returns
Promise<null
>
A Promise that resolves to null
when the page slug is set.
Example
Designer Ability
page.getPublishPath()
Retrieves the path that will be used when the page is published.
Syntax
Returns
Promise<string
>
A Promise that resolves to a string with the value of the page path.
Example
Designer Ability
page.getTitle()
Retrieves the title of the page.
Syntax
Returns
Promise<string
>
A Promise that resolves to a string with the value of the page title.
Example
Designer Ability
page.setTitle(title)
Sets the title of the page to the provided value.
Syntax
Parameters
- title:
string
- The new title to set for the page.
Returns
Promise<null
>
A Promise that resolves to null
when the page title has been set.
Example
Designer Ability
page.getDescription()
Retrieves the current description of the page.
Syntax
Returns
Promise<string
>
A Promise that resolves to a string containing the page description.
Example
Designer Ability
page.setDescription(description)
Sets the description of the page to the provided value.
Syntax
Parameters
- description:
string
- The new description to set for the page.
Returns
Promise<null
>
A Promise that resolves to null
when the page description has been set.
Example
Designer Ability
page.getCollectionId()
Get the collection ID from a page that is automatically generated from a collection.
Syntax
Returns
Promise<string
>
A Promise that resolves to the collection ID
Example
Errors
If the method fails to find a collection, the method will return an error with the following cause and message.
Designer Ability
page.getCollectionName()
Get the collection name from a page that is automatically generated from a collection.
Syntax
Returns
Promise<string
>
A Promise that resolves to the collection name.
Example
Errors
If the method fails to find a collection, the method will return an error with the following cause and message.