Link

A link configured in a block schema link variable.

A link configured in a block schema link variable. Resolves to either an on-site page, product, or blog post, or a static external URL.

Properties

host

Deprecated

Use LinkDrop#url instead. The host is omitted for static URL links, which breaks external URLs.

Returns: String or nil

linked_resource

The page, product, or blog post linked to this variable, when configured as an on-site resource. Use the linked object's type property to distinguish between page, experience, accommodation, and blog post.

Returns: PageDrop or ProductDrop or BlogPostDrop or nil — nil for static URL links and when the target resource cannot be resolved.

{% case link.linked_resource.type %}
  {% when "page" %}
    ...
  {% when "experience" %}
    ...
  {% when "accommodation" %}
    ...
  {% when "blog_post" %}
    ...
{% endcase %}

new_tab

Whether the link should open in a new browser tab.

Returns: Boolean

path

Deprecated

Use LinkDrop#url instead. The path omits the host for static URL links, which breaks external URLs.

Returns: String

url

The link destination. On-site resources return a relative path; static URL links return the full URL.

Returns: String — an empty string when the link target is missing or invalid.

On this page