webflow.getAllPagesAndFolders()
webflow.getAllPagesAndFolders()
Retrieves all pages and folders in the current site.
Syntax
webflow.getAllPagesAndFolders(): Promise<Array<Page | Folder>>
Returns
Promise<Array<Folder | Page>>
A Promise that resolves to an array of page and/or folder objects.
Example
// Get all pages and folders
const pagesAndFolders = await webflow.getAllPagesAndFolders()
// Print Page Details
const pages = pagesAndFolders?.filter(i => i.type === "Page")
await Promise.all(pages.map(async page => {
const pageName = await page.getName()
console.log(`Page: ${pageName}`)
}))
const folders = pagesAndFolders?.filter(i => i.type === "PageFolder")
await Promise.all(folders.map(async folder => {
const folderName = await folder.getName()
console.log(`Folder: ${folderName}`)
}))
Designer Ability
Designer Ability | Locale | Branch | Workflow | Sitemode |
---|---|---|---|---|
canReadPageSettings | Any | Any | Any | Any |