Sitegeist.Archaeopteryx
Sitegeist.Archaeopteryx copied to clipboard
FEATURE Inspector link value object property
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
Sounds really good. But just to be clear: This does not affect the existing editor and its output, right?
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))
Does this work in your project? @mficzel or @nezaniel? in that case we should resolve the conflicts and merge?
yep, works