PHPackages                             codeq/jumpmarkers - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. codeq/jumpmarkers

ActiveNeos-package

codeq/jumpmarkers
=================

Link content nodes as anchors and rendering a anchor navigation.

v3.2.0(2y ago)517.8k↑37.5%3GPL-3.0-or-laterPHP

Since Sep 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/code-q-web-factory/CodeQ.JumpMarkers)[ Packagist](https://packagist.org/packages/codeq/jumpmarkers)[ RSS](/packages/codeq-jumpmarkers/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (14)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/064ded2f0485211bae72af16b749b0b86680b5302b8779bde6247da9d49d617c/68747470733a2f2f706f7365722e707567782e6f72672f636f6465712f6e656f732d6c696e6b2f762f737461626c65)](https://packagist.org/packages/codeq/neos-link)[![License](https://camo.githubusercontent.com/f46a840f5aecefb860e249fe4bf6673bef4a276e384a4f6143d45c89c90dca3b/68747470733a2f2f706f7365722e707567782e6f72672f636f6465712f6e656f732d6c696e6b2f6c6963656e7365)](LICENSE)

CodeQ.JumpMarkers
=================

[](#codeqjumpmarkers)

This package allows linking to a content node as a jump marker and rendering a jump marker navigation.

Installation
------------

[](#installation)

CodeQ.JumpMarkers is available via packagist run `composer require codeq/jumpmarkers`. We use semantic versioning so every breaking change will increase the major-version number.

Configuration
-------------

[](#configuration)

### 1. Extend content nodes with jump marker properties

[](#1-extend-content-nodes-with-jump-marker-properties)

Add the `CodeQ.JumpMarkers:Mixin.SectionConfiguration` mixin to any content NodeType that you would want to link in a jump marker navigation, or as a permalink with a hash.

E.g. this code adds such ability to every Content NodeType:

```
'Neos.Neos:Content':
  superTypes:
    'CodeQ.JumpMarkers:Mixin.SectionConfiguration': true
```

[![inspector editor](editor-demo.png)](editor-demo.png)

### 2. Make content nodes available in the link search dialog of the backend

[](#2-make-content-nodes-available-in-the-link-search-dialog-of-the-backend)

By default, Neos offers only document nodes for selection in its link search dialog. You can also allow content nodes with a section title or id set:

[![linking demo](linking-demo.png)](linking-demo.png)

To enable this feature, you must allow the SectionConfiguration in the link configuration nodeTypes option like this:

```
'YOUR.Site:Content.Text':
  superTypes:
    'Neos.Neos:Content': true
  ui:
    label: Text
    icon: file-text
    position: 200
    inlineEditable: true
  properties:
    text:
      type: string
      defaultValue: ''
      ui:
        inlineEditable: true
        inline:
          editorOptions:
            linking:
              nodeTypes: ['Neos.Neos:Document', 'CodeQ.JumpMarkers:Mixin.SectionConfiguration']
    link:
      type: string
      ui:
        label: 'Link'
        reloadPageIfChanged: false
        inspector:
          group: general
          editor: 'Neos.Neos/Inspector/Editors/LinkEditor'
          editorOptions:
            linking:
              nodeTypes: ['Neos.Neos:Document', 'CodeQ.JumpMarkers:Mixin.SectionConfiguration']

```

Our [ServicesNodesControllerAspect](Classes/Aspects/ServicesNodesControllerAspect.php) will make sure that only content nodes with a jumpMarkerTitle or sectionId will be shown in the list.

### 3. Render the anchor id in the frontend

[](#3-render-the-anchor-id-in-the-frontend)

You can either render the id on the item itself with:

```
prototype(Vendor:Site) < prototype(Neos.Neos:ContentComponent) {
    id = CodeQ.JumpMarkers:NodeAnchorId
    renderer = afx`

            ...
