page.isDraft()
page.isDraft()
Checks if the page is a draft.
Syntax
page.isDraft(): Promise<boolean>
Returns
Promise<boolean
>
A Promise that resolves to a boolean
value.
Example
// Get Current Page
const currentPage = await webflow.getCurrentPage() as Page
// Check page status
const isDraft = await currentPage.isDraft()
// Print page status
if (isDraft) {
console.log('Page is draft')
} else {
console.log('Page is not a draft')
}
Designer Ability
Designer Ability | Locale | Branch | Workflow | Sitemode |
---|---|---|---|---|
canReadPageSettings | Any | Any | Any | Any |
page.setDraft(isDraft)
page.setDraft(isDraft)
Sets the draft mode of the page.
Syntax
page.setDraft(isDraft: boolean): Promise<null>
Parameters
- isDraft:
boolean
- Set totrue
to mark the page as a draft,false
otherwise.
Returns
Promise<null
>
A Promise that resolves to null
.
Example
// Get Current Page
const currentPage = await webflow.getCurrentPage() as Page
// Set page as draft
await currentPage.setDraft(true)
const isDraft = await currentPage.isDraft()
// Print status
console.log(isDraft)
Designer Ability
Designer Ability | Locale | Branch | Workflow | Sitemode |
---|---|---|---|---|
canManagePageSettings | Any | Any | Any | Any |
page.isPasswordProtected()
page.isPasswordProtected()
Checks if the page is password-protected.
Syntax
page.isPasswordProtected(): Promise<boolean>
Returns
Promise<boolean
>
A Promise that resolves to a boolean
value.
Example
// Get Current Page
const currentPage = await webflow.getCurrentPage() as Page
// Check if current page is the homepage
const isPasswordProtected = await currentPage.isPasswordProtected()
if (isPasswordProtected) {
console.log('Current page is PasswordProtected')
} else {
console.log('Current page is not PasswordProtected')
}
Designer Ability
Designer Ability | Locale | Branch | Workflow | Sitemode |
---|---|---|---|---|
canReadPageSettings | Any | Any | Any | Any |
page.getUtilityPageKey()
page.getUtilityPageKey()
Retrieves the utility page key if available.
Syntax
page.getUtilityPageKey(): Promise<null | string>
Returns
Promise<null | string
>
A Promise that resolves to a string
with the value of the utility key, or null
if the page is not a utility page.
Example
// Get Current Page
const currentPage = await webflow.getCurrentPage() as Page
// Get utily key
const utilityKey = await currentPage.getUtilityPageKey()
console.log("Utility Key", utilityKey)
Designer Ability
Designer Ability | Locale | Branch | Workflow | Sitemode |
---|---|---|---|---|
canReadPageSettings | Any | Any | Any | Any |
page.isHomepage()
page.isHomepage()
Checks if the page is set as the homepage.
Syntax
page.isHompeage(): Promise<boolean>
Returns
Promise<boolean
>
A Promise that resolves to a boolean
value.
Example
// Get Current Page
const currentPage = await webflow.getCurrentPage() as Page
// Check if current page is the homepage
const isHomepage = await currentPage.isHomepage()
if (isHomepage) {
console.log('Current page is the Homepage')
} else {
console.log('Current page is not the Homepage')
}
Designer Ability
Designer Ability | Locale | Branch | Workflow | Sitemode |
---|---|---|---|---|
canReadPageSettings | Any | Any | Any | Any |