clonePage
Syntax | clonePage(pageId, parentId, title) | Package | |
Alias | Pkg Usage |
Description
Clones the page and returns the id of the cloned page. Takes page id to clone, new parent page id and new page title (title is optional).
Parameters
Parameter name | Type | Required | Description |
|---|---|---|---|
pageId | Number | Yes | The ID of the selected page to clone. |
parentId | Number | Yes | The ID of the parent page. If the page is at the root level (top level) the parent page should be the spaces home page. |
title | String | No | Title of the new page. If excluded the title will be taken from the original page. |
Return Type
Number
The return value will be the ID of the duplicated page.
Examples
Example 1
Result: Page 11801 is duplicated.
clonePage(11801, 11800);
//11801 represents the ID of the page that will be duplicated under page 11800.Example 2
Result: Page 11801 is duplicated and id given a tile of "Cloned Page".
clonePage(11801 ,11800, "Cloned Page")