sitegeist / Sitegeist.Archaeopteryx

The missing link editor for Neos
MIT License
21 stars 11 forks source link

Missing setting "TargetBlank" and "RelNofollow" in Inspector view #38

Closed brachycera closed 12 months ago

brachycera commented 1 year ago

Thanks for the nice Link-Editor!

Am I missing something or is it not possible to activate the options "TargetBlank" and "RelNofollow" in the Inspector view?

  inspector:
    group: 'image'
    editor: 'Sitegeist.Archaeopteryx/Inspector/Editors/LinkEditor'
    editorOptions:
      # doesn't work
      # linking:
         #  relNofollow: true
         # targetBlank: true
      linkTypes:
        # doesn't work
        # 'Sitegeist.Archaeopteryx:Web':
         #  relNofollow: true
         # targetBlank: true
        'Sitegeist.Archaeopteryx:PhoneNumber':
          enabled: false
Benjamin-K commented 12 months ago

As you will only get the link from the property in the inspector, this is not a task for this editor. You need to create separate properties for this like so:

'Your.Package:NodeType':
  # ...
  properties:
    link:
      type: string
      # ...
    targetBlank: # or only target, if you prefer to set more than only _blank
      type: boolean
      # ...
    relNoFollow:
      type: boolean
brachycera commented 12 months ago

@Benjamin-K Thanks for the reply and the clarification :wink:. I was just wondering because when I used the Link editor with the inline editor the options "TargetBlank" and "RelNofollow" worked:

inline:
  editorOptions: 
    linking:
      'Sitegeist.Archaeopteryx':
        linkTypes:
          'Sitegeist.Archaeopteryx:PhoneNumber':
            enabled: false
      relNofollow: true
      targetBlank: true

But when I used it in the inspector, the Link editor didn't showed the options. But separate properties will of course do the job.

Benjamin-K commented 12 months ago

@brachycera This is because the inspector renders the full html markup and therefore is able to render additional markup, whilst the inspector property only renders the link and you have to create the additional markup yourself.

In theory you could create a custom editor that saves additional values in the node property, but in the end this wouldn't save you much time.