folder.setParent(parent: Folder)
folder.setParent(parent: Folder)
Assign a new parent folder to the selected folder.
Syntax
folder.setParent(parent: Folder): Promise<null>
Parameters
- parent :
Folder
- The parent folder to set for the current folder.
Returns
Promise<null
>
A Promise that resolves to null
when the parent folder is set.
Example
// Get all Pages and folders
const pagesAndFolders = await webflow.getAllPagesAndFolders()
// Create and name new folder
const newFolder = await webflow.createPageFolder()
await newFolder.setName("Parent Folder")
for (let folder of pagesAndFolders) {
await folder.setParent(newFolder)
}
Designer Ability
Designer Ability | Locale | Branch | Workflow | Sitemode |
---|---|---|---|---|
canManagePageSettings | Any | Any | Any | Any |