Link Element
The Link element represents an Link Block in the Webflow Designer.
Properties
Methods
element.getTarget()
Get the target value of the link block element.
Syntax
Returns
Promise<null | string | Page | AnyElement | Asset>
A Promise that resolves to an the target value of the link. The target value can be a string, Page, Element, or an Asset object.
Example
Designer Ability
Checks for authorization only
element.setSettings(mode, target, metadata)
Apply settings for a Link Block element. Including the type of link, its value, and metadata settings.
Syntax
Parameters
- Mode: enum - The type of link to set. Can be a url, email, or phone number; a link to another page or pageSection; as well as an attachment.
- Target: string | Page | Element | Asset - The value of the link. The value type determined by the selected mode. For example, if the link mode is “attachment” the method expects an Asset object.
- Metadata: object - Optional metadata for link settings:
- openInNewTab: boolean - Choose to open the link in a new tab
- subject: string - The subject line of an
email
link.
Returns
Promisenull
A Promise that resolves to null
Example
Designer Ability
Checks for authorization only