https://github.com/flownative/neos-customdocumenturirouting
This allows to have custom document URI paths for document nodes
https://github.com/flownative/neos-customdocumenturirouting
Last synced: about 2 months ago
JSON representation
This allows to have custom document URI paths for document nodes
- Host: GitHub
- URL: https://github.com/flownative/neos-customdocumenturirouting
- Owner: flownative
- License: mit
- Created: 2017-11-21T16:51:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-13T13:25:25.000Z (over 1 year ago)
- Last Synced: 2024-11-06T21:06:56.143Z (7 months ago)
- Language: PHP
- Size: 37.1 KB
- Stars: 4
- Watchers: 4
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](http://opensource.org/licenses/MIT)
[](https://packagist.org/packages/flownative/neos-customdocumenturirouting)
[](https://www.flownative.com/en/products/open-source.html)# Custom Document URI paths for Neos
This allows to have custom document URI paths for document nodes. This means, independent from the
URI path that is usually built from the uriPathSegments of each node, a document can be given a
full, unique, custom URI path.## Installation
`composer require flownative/neos-customdocumenturirouting`
## Configuration
After installing the package, by default it looks for a property called `uriPath` in document nodes.
The `uriPath` property can be added to your document nodes by using the provided
`Flownative.Neos.CustomDocumentUriRouting:UriPathMixin`.The used mixin node type name and property name can be changed in the settings, if you like to use a different name:
Flownative:
Neos:
CustomDocumentUriRouting:
mixinNodeTypeName: 'Acme.Product:UriPathMixin'
uriPathPropertyName: 'myCustomUriPathProperty'Make sure that, if you configure a custom mixin node type name, that node type actually provides a property with the
name you defined in `uriPathPropertyName`.### Excluding paths from matching
In order to exclude specific request paths (e.g. public resources), the `matchExcludePatterns`
setting exists. All given array values will skip the matching process for request paths that start
with the value. The default shipped with the package is:Neos:
CustomDocumentUriRouting:
matchExcludePatterns:
- '_Resources'Any URI starting with `_Resources` will be ignored by the package and passed through.
### A note about performance
This package provides a custom node route part handler which will check if the current HTTP request
matches a given uri path. The route part handler uses a Flow Query to do that. If the Flow Query finds too
many nodes, because the criteria is too broad, frontend and backend performance can suffer, especially
if your content repository contains thousands of nodes.Therefore try to limit possible matches to a minimum: only use the configured mixin in those node types
which actually need them. For example, if you have a custom "Landing Page" node type, you may want to
define the `CustomDocumentUriRoutingMixin` as a super type. But what you won't do is assign that mixin
to the `Neos.Neos:Document` node type - because that would match all possible document nodes in the system.## Credits
Development of this package has been sponsored by web&co OG, Vienna, Austria.