webflow.getAllPagesAndFolders()

Retrieves all pages and folders in the current site.

Syntax

1webflow.getAllPagesAndFolders(): Promise<Array<Page | Folder>>

Returns

Promise<Array<Folder | Page>>

A Promise that resolves to an array of page and/or folder objects.

Example

1// Get all pages and folders
2const pagesAndFolders = await webflow.getAllPagesAndFolders()
3
4// Print Page Details
5const pages = pagesAndFolders?.filter(i => i.type === "Page")
6await Promise.all(pages.map(async page => {
7
8 const pageName = await page.getName()
9 console.log(`Page: ${pageName}`)
10
11}))
12
13const folders = pagesAndFolders?.filter(i => i.type === "PageFolder")
14await Promise.all(folders.map(async folder => {
15
16 const folderName = await folder.getName()
17 console.log(`Folder: ${folderName}`)
18
19}))

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny