page.setDraft()

Set the draft status of the page.

Syntax

1page.setDraft(isDraft: boolean): Promise<null>

Parameters

  • isDraft: boolean - Whether the page should be set to draft mode.

Returns

Promise<null>

A promise that resolves to null.

Example

1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Set page as draft
5await currentPage.setDraft(true)
6const isDraft = await currentPage.isDraft()
7
8// Print status
9console.log(isDraft)

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canManagePageSettingsAnyAnyAnyAny
Built with