j6s/flow-transliterated-routes

Last activity on 1 January 2021
  • 5723
composer require j6s/flow-transliterated-routes

Small package that ties in behat/transliterator with flows IdentityRoutePart to create smart international slugs

2.0.0

Small package that ties in behat/transliterator with flows IdentityRoutePart to create smart international slugs

Version
2.0.0
Type
neos-package
Release Date
31.01.2021 19:47:45
Source
git
Distribution
zip
Requires
Requires (dev)
Suggest
None
Provides
None
Conflicts
None
Replaces
None
MIT 1edf142baad4be584b9b2eedf806425f5377096d

Flow Transliterated Routes Build Status

Small package that ties behat/transliterator into the default behaviour of IdentityRoutePart of the Flow Framework to create smart international slugs.

Installation

$ composer require j6s/flow-transliterated-routes

Example Routes.yaml

- name: 'My.News:DetailPage'
  uriPattern: '{article}'
  routeParts:
    article:
      handler: 'J6s\TransliteratedRoutes\IdentityRoutePart'
      options:
        objectType: 'My\News\Domain\Model\Article'
        uriPattern: '{name}-{urlIdentifier}'
        replacements:
          '&': 'and'
          '|': 'or'

Configuration

All configuration from the default IdentityRoutePart has been retained with the notable difference, that they are shifted into the options key.

Additionally the following options exist:

  • additionalReplacements: Map of replacement that uses the character that should be replaced and it's replacement as a value. In order to be backwards-compatible with Flows default IdentityRoutePart this defaults to replacements for german special characters. If you add replacements of your own and whish to retain german special characters, you have to add them to the map manually.
The content of the readme is provided by Github
The same vendor provides 2 package(s).