neosidekick/ui-reverse-search

This package extends the Neos UI document node search with a URI search function

1.0.2 2024-08-19 13:36 UTC

This package is auto-updated.

Last update: 2024-11-19 14:12:41 UTC


README

Did you ever ask yourself why you can search for the title in the Neos UI document tree, but not by public URI or node path ❓ Well, we got you ❗

This package extends the document tree search with an ability to search by URI or node path. Just copy the URI from your browser or the node path into the search field and the document will be highlighted in the document tree, if found 😍

Demo

Installation

NEOSidekick.UiReverseSearch is available via Packagist. Add "neosidekick/ui-reverse-search" : "^1.0" to the require section of the composer.json or run:

composer require neosidekick/ui-reverse-search

We use semantic versioning, so every breaking change will increase the major version number.

Configuration

Some Neos installations use a suffix to the routes, like Neos.Demo uses .html. Our package tries to get this information first from Neos.Flow.mvc.routes.Neos.Neos.variables.defaultUriSuffix. If the value in this configuration is not the same as the one configured in your Routes.yaml, you can use our setting NEOSidekick.UiReverseSearch.overrideNodeUriPathSuffix to override the uri suffix for the resolving in this package.

How does it work?

The Neos UI uses FlowQuery and the Neos\Neos\Ui\FlowQueryOperations\SearchOperation to filter the document nodes. Our package extends and overrides this implementation by first checking if the search term matches the URI structure. If this is the case, it uses Neos\Neos\Routing\FrontendNodeRoutePartHandler to resolve the URI to a node context path. The resolving for the node path works quite similar, except for that we don't have to first resolve the URI to a node context path beforehand but we directly look up the node by the given node path.

Known limitations

When resolving the node by its public URI, we discard the information about the dimensions and only work with the current context of the UI. So if your UI is in the German language dimension, and you paste the public URI of a document in the Englisch language dimension, our package will find its sibling in the German language dimension, if existent.