page.isHomepage()

Check if the page is set as the homepage.

Syntax

1page.isHomepage(): Promise<boolean>

Returns

Promise<boolean>

A promise that resolves to a boolean value indicating whether the page is the homepage.

Example

1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Check if current page is the homepage
5const isHomepage = await currentPage.isHomepage()
6
7if (isHomepage) {
8 console.log('Current page is the Homepage')
9} else {
10 console.log('Current page is not the Homepage')
11}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny
Built with