folder.getParent()
folder.getParent()
Get parent folder of selected folder.
Syntax
folder.getParent(): Promise<null | Folder>
Returns
Promise<null
| Folder>
A Promise that resolves to a Folder
object if a parent exists, or null
if no parent is found.
Example
// Get all Pages and folders
const pagesAndFolders = await webflow.getAllPagesAndFolders()
for (let folder of pagesAndFolders) {
const childName = await folder.getName()
const parent = await folder.getParent()
const parentName = await parent?.getName()
console.log(`Folder: ${childName}`, `Parent: ${parentName}`)
}
Designer Ability
Designer Ability | Locale | Branch | Workflow | Sitemode |
---|---|---|---|---|
canReadPageSettings | Any | Any | Any | Any |