sitegeist/archaeopteryx

Last activity 17 days ago
  • 12
  • 1
  • 8
composer require sitegeist/archaeopteryx

The missing link editor for Neos

dev-main

The missing link editor for Neos

Version
dev-main
Type
neos-plugin
Release Date
04.06.2021 08:59:29
Source
git
Distribution
zip
Requires
Requires (dev)
Suggest
None
Provides
None
Conflicts
None
Replaces
None
MIT 83635207c19844b6756728c23f6cc6ccdc2dd8be

Sitegeist.Archaeopteryx

The missing link editor for Neos

Currently in alpha

This package is currently being tested. Do not use it in production yet! This message will disappear once the package is ready for release.

Authors & Sponsors

The development and the public-releases of this package was generously sponsored by our customer https://www.cornelsen.de and our employer https://www.sitegeist.de.

Installation

composer require sitegeist/archaeopteryx:dev-main

Links in Rich Text

Sitegeist.Archaeopteryx is a drop-in replacement for the default Link Editor that is used for Rich Text in Neos. Once installed, you'll notice that the default editor won't show up anymore if you try to add a link to some piece of text.

Instead, a dialog with a lot more options will open:

Sitegeist.Archaeopteryx is fully backwards-compatible. You don't have to worry about links that are already in the system. You can install or uninstall Sitegeist.Archaeopteryx at any point in time while retaining full functionality of all of your links.

Link in Inspector properties

Besides the integration with the Rich Text editor toolbar, Sitegeist.Archaeopteryx also provides an Inspector Editor that can be used as a replacement for Neos.Neos/Inspector/Editors/LinkEditor.

In case of the Inspector Editor, Sitegeist.Archaeopteryx won't automatically override the default. Instead, you need to configure it as a properties' inspector editor explicitly:

'Vendor.Site:MyContent':
  # ...
  properties:
    link:
      type: string
      ui:
        inspector:
          # ...
          editor: 'Sitegeist.Archaeopteryx/Inspector/Editors/LinkEditor'

Link Types

Sitegeist.Archaeopteryx ships with 4 built-in Link Types.

Web

The Web Link Type handles external links, so links that begin with http:// or https://.

Document

The Document Link Type handles internal links. The editor offers you a document tree from which you can select documents from within your site. It also offers a search and a node type filter similar to the main document tree in the left side bar of the Neos UI.

The Document Link Type can be configured as follows:

RTE Configuration:

'Vendor.Site:MyAwesomeNodeTypeWithSomeRichText':
  # ...
  properties:
    text:
      type: string
      ui:
        inlineEditable: true
        inline:
          editorOptions:
            # ..
            linking:
              #
              # Sitegeist.Archaeopteryx will consider the
              # startingPoint option in the linking
              # section of the RTE configuration.
              #
              # However, the startingPoint option of the
              # extra key 'Sitegeist.Archaeopteryx' from
              # below takes precedence.
              #
              startingPoint: '/sites/vendor-site/node-2ohiwg6ardhhf'
              'Sitegeist.Archaeopteryx':
                linkTypes:
                  'Sitegeist.Archaeopteryx:Node':
                    startingPoint: '/sites/vendor-site/node-40up2e13w4fd9' # Default: current site node
                    baseNodeType: 'Vendor.Site' # default: Neos.Neos:Document
                    loadingDepth: 8 # default: 4

Inspector Editor Configuration:

'Vendor.Site:MyAwesomeNodeTypeWithALinkProperty':
  # ...
  properties:
    link:
      type: string
      ui:
        inspector:
          # ...
          editor: 'Sitegeist.Archaeopteryx/Inspector/Editors/LinkEditor'
          editorOptions:
            linkTypes:
              'Sitegeist.Archaeopteryx:Node':
                startingPoint: '/sites/vendor-site/node-40up2e13w4fd9' # Default: current site node
                baseNodeType: 'Vendor.Site' # default: Neos.Neos:Document
                loadingDepth: 8 # default: 4

Asset

The Asset Link Type handles links to files from the Media Module. The editor will offer you a media browser from which you can select any asset from within your site.

Mail To

The Mail To Link Type handles e-mail links, so links that start with mailto:. Links with the mailto: protocol allow not only to specify a recipient, but also to configure a subject, a message body, carbon copy (CC) recipients and blind carbon copy (BCC) recipients for the outgoing e-mail.

The editor for the Mail To Link Type will offer all of those fields. Each field can be deactivated via configuration.

The Mail To Link Type can be configured as follows:

RTE Configuration:

'Vendor.Site:MyAwesomeNodeTypeWithSomeRichText':
  # ...
  properties:
    text:
      type: string
      ui:
        inlineEditable: true
        inline:
          editorOptions:
            # ..
            linking:
              'Sitegeist.Archaeopteryx':
                linkTypes:
                  'Sitegeist.Archaeopteryx:MailTo':
                    enabledFields:
                      subject: true
                      cc: true
                      bcc: true
                      body: true

Inspector Editor Configuration:

'Vendor.Site:MyAwesomeNodeTypeWithALinkProperty':
  # ...
  properties:
    link:
      type: string
      ui:
        inspector:
          # ...
          editor: 'Sitegeist.Archaeopteryx/Inspector/Editors/LinkEditor'
          editorOptions:
            linkTypes:
              'Sitegeist.Archaeopteryx:MailTo':
                enabledFields:
                  subject: true
                  cc: true
                  bcc: true
                  body: true

Link Options

In RTE context, Sitegeist.Archaeopteryx allows you to set some additional link options. These are:

  • Anchor: This will add a string to the hash-section of the URL (the part after #)
  • Title: This will set the title attribute of the resulting <a>-Tag
  • Open in new window: This will set the target attribute of the resulting <a>-Tag to _blank
  • rel="nofollow": This will set the rel attribute of the resulting <a>-Tag to nofollow

Not all Link Types support all of these options however. Here's an overview of what Link Type supports which options:

Link Type Supported Link Options
Web Anchor, Title, Open in new window, rel="nofollow"
Document Anchor, Title, Open in new window, rel="nofollow"
Asset Title, Open in new window, rel="nofollow"
Mail To - none -

To enable or disable certain Link Options generally, you can use the linking section of your RTE configuration:

'Vendor.Site:MyAwesomeNodeTypeWithSomeRichText':
  # ...
  properties:
    text:
      type: string
      ui:
        inlineEditable: true
        inline:
          editorOptions:
            # ..
            linking:
              anchor: true
              title: true
              relNofollow: true
              targetBlank: true

Contribution

We will gladly accept contributions. Please send us pull requests.

LICENSE

see LICENSE

The content of the readme is provided by Github
The same vendor provides 27 package(s).