Sitegeist.Archaeopteryx icon indicating copy to clipboard operation
Sitegeist.Archaeopteryx copied to clipboard

FEATURE Inspector link value object property

Open mhsdesign opened this issue 10 months ago • 4 comments

This feature introduces a php link value object which can also be used as node property with editor support.

Advanced Inspector Editor Configuration with Sitegeist\Archaeopteryx\Link value object type:

'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>
`

To try this feature out already, require this dev branch in your composer root:

composer require --no-update sitegeist/archaeopteryx:"dev-feature/inspectorLinkProperty as 1.4.0"

Demo Video:

https://github.com/sitegeist/Sitegeist.Archaeopteryx/assets/85400359/821b6b14-9e06-4727-9348-7235aece56ef

mhsdesign avatar Oct 23 '23 18:10 mhsdesign

Sounds really good. But just to be clear: This does not affect the existing editor and its output, right?

Benjamin-K avatar Oct 25 '23 09:10 Benjamin-K

Yes exactly. This feature is only available for the type: 'Sitegeist\Archaeopteryx\Link'. If you use "string" everything will stay as is ;)

(Im thinking about allowing fragments also for strings (if enabled) as it would be possible to encode this into the uri (obviously))

mhsdesign avatar Oct 25 '23 09:10 mhsdesign

Does this work in your project? @mficzel or @nezaniel? in that case we should resolve the conflicts and merge?

mhsdesign avatar Feb 02 '24 16:02 mhsdesign

yep, works

nezaniel avatar Apr 11 '24 06:04 nezaniel