folder.setParent(parent: Folder)

Assign a new parent folder to the selected folder.

Syntax

1folder.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

1// Get all Pages and folders
2const pagesAndFolders = await webflow.getAllPagesAndFolders()
3
4// Create and name new folder
5const newFolder = await webflow.createPageFolder()
6await newFolder.setName("Parent Folder")
7
8for (let folder of pagesAndFolders) {
9
10 await folder.setParent(newFolder)
11
12}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canManagePageSettingsAnyAnyAnyAny