page.usesTitleAsOpenGraphTitle()

Checks if the page uses the page title as the Open Graph title.

Syntax

1page.usesTitleAsOpenGraphTitle(): Promise<boolean>

Returns

Promise<boolean>

A Promise that resolves to a boolean value.

Example

TypeScript
1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Check if page is using the Title as the Open Graph title
5const isOpenGraphTitle = await currentPage.usesTitleAsOpenGraphTitle()
6
7// Print results
8if (isOpenGraphTitle) {
9
10 console.log('Page uses Title as Open Graph Title')
11} else {
12 console.log('This page has a custom Open Graph Title')
13}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny

page.useTitleAsOpenGraphTitle(use)

Indicate whether the page should use its title as the Open Graph (OG) title.

Syntax

1page.useTitleAsOpenGraphTitle(use: boolean): Promise<null>

Parameters

  • use: boolean - Set to true to use the page title as the OG title, false otherwise.

Returns

Promise<null>

A Promise that returns to null

Example

TypeScript
1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Set page title as open graph title
5await currentPage.useTitleAsOpenGraphTitle(true)
6const title = await currentPage.getOpenGraphTitle()
7console.log(title)

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canManagePageSettingsAnyAnyAnyAny

page.getOpenGraphTitle()

Retrieves the Open Graph title of the page.

Syntax

1page.getOpenGraphTitle(): Promise<string>

Returns

Promise<string>

A Promise that resolves to a string with the Open Graph title of the page.

Example

TypeScript
1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Get Open Graph Title
5const openGraphTitle = await currentPage.getOpenGraphTitle()
6console.log("Open Graph Title", openGraphTitle)

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny

page.setOpenGraphTitle(title)

Sets the Open Graph (OG) title of the page to the provided value.

Syntax

1page.setOpenGraphTitle(title: string): Promise<null>

Parameters

  • title: string - The new OG title to set for the page.

Returns

Promise<null>

A Promise that returns to null.

Example

TypeScript
1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Set Open Graph Title
5await currentPage.setOpenGraphTitle("My New Title")
6
7// Print results
8const openGraphTitle = await currentPage.getOpenGraphTitle()
9console.log("Open Graph Title", openGraphTitle)

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canManagePageSettingsAnyAnyAnyAny

page.usesDescriptionAsOpenGraphDescription()

Checks if the page uses its description as the Open Graph description.

Syntax

1page.usesDescriptionAsOpenGraphDescription(): Promise<boolean>

Returns

Promise<boolean>

A Promise that resolves to a boolean value.

Example

TypeScript
1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Check page status
5const isOpenGraphDescription = await currentPage.usesDescriptionAsOpenGraphDescription()
6
7// Print page status
8if (isOpenGraphDescription) {
9
10 console.log('Page uses Page Description as Open Graph Description')
11} else {
12 console.log('This page has a custom Open Graph Description')
13}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny

page.useDescriptionAsOgDescription(use)

Indicate whether the page should use its description as the Open Graph description.

Syntax

1page.useDescriptionAsOgDescription(use: boolean): Promise<null>

Parameters

  • use: boolean - Set to true to use the page description as the OG description, false otherwise.

Returns

Promise<null>

A Promise that resolves to null when the Open Graph description is set.

Example

TypeScript
1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Set page description open graph description
5await currentPage.useDescriptionAsOpenGraphDescription(true)
6const description = await currentPage.getOpenGraphDescription()
7console.log(description)

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canManagePageSettingsAnyAnyAnyAny

page.getOpenGraphDescription()

Retrieves the Open Graph description of the page.

Syntax

1page.getOpenGraphDescription(): Promise<string>

Returns

Promise<string>

A Promise that resolves to a string value of the Open Graph description.

Example

TypeScript
1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Get Open Graph Description
5const openGraphDescription = await currentPage.getOpenGraphDescription()
6console.log("Open Graph Description", openGraphDescription)

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny

page.setOpenGraphDescription(description)

Sets the page’s Open Graph description to the provided value.

Syntax

1page.setOpenGraphDescription(description: string): Promise<null>

Parameters

  • description: string - The new OG description to set for the page.

Returns

Promise<null>

A Promise that resolves to null when the Open Graph description is set.

Example

TypeScript
1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Set Open Graph Description
5await currentPage.setOpenGraphDescription(description)
6
7// Print results
8const openGraphDescription = await currentPage.getOpenGraphDescription()
9console.log("Open Graph Description", openGraphDescription)

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canManagePageSettingsAnyAnyAnyAny

page.getOpenGraphImage()

Retrieves the URL of the Open Graph image associated with the page.

Syntax

1page.getOpenGraphImage(): Promise<string>

Returns

Promise<string>

A Promise that resolves to a string with the URL of the Open Graph image.

Example

TypeScript
1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Get Open Graph image and Print Details
5const openGraphImage = await currentPage.getOpenGraphImage()
6console.log(openGraphImage)

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canReadPageSettingsAnyAnyAnyAny

page.setOpenGraphImage(url)

Sets the URL of the Open Graph image associated with the page.

Syntax

1page.setOpenGraphImage(url: string): Promise<null>

Parameters

  • url: string - The new URL of the Open Graph image to set for the page.

Returns

Promise<null>

A Promise that resolves to null when the Open Graph image is set.

Example

TypeScript
1// Get Current Page
2const currentPage = await webflow.getCurrentPage() as Page
3
4// Set open graph image and print details
5await currentPage.setOpenGraphImage("example.com/image.jpg")
6const openGraphImage = currentPage.getOpenGraphImage()
7console.log(openGraphImage)

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canManagePageSettingsAnyAnyAnyAny