Skip to content

1.6.0 Support link options in inspector

Choose a tag to compare

@mhsdesign mhsdesign released this 08 May 11:49

What's Changed

The type: string now supports the option anchor.
In case you relied previously on the custom link editor to insert node link with anchor they will no longer be shown there but be editable in the document tab. Make sure to enable the anchor option as otherwise the anchor will go missing when selecting a new node to target.

someLink:
  type: string
  ui:
    inspector:
      editor: Sitegeist.Archaeopteryx/Inspector/Editors/LinkEditor
      editorOptions:
        anchor: true

This release introduces the Sitegeist\Archaeopteryx\Link value object type
which allows for advanced usage.

'Vendor.Site:MyAwesomeNodeTypeWithALinkValueObjectProperty':
  # ...
  properties:
    link:
      type: Sitegeist\Archaeopteryx\Link
      ui:
        inspector:
          # ...
          editorOptions:
            # optionally enable link options, which will be encoded into the value object.
            anchor: true
            title: true
            relNofollow: true
            targetBlank: true

As the value object can serialize more than just the href we can also edit other link related options like title and the target.

The link value object can be queried as usual. An example rendering would look the following:

link = ${q(node).property("link")}
renderer = afx`
    <a href={props.link.href} title={props.link.title} target={props.link.target} rel={props.link.rel} rel.@if={props.link.rel != []}>
        My Text
    </a>
`

Full Changelog: v1.5.3...1.6.0