calien/persisted-sanitized-routing

This package is abandoned and no longer maintained. The author suggests using the calien/extended-routing package instead.

Persisted Sanitized Pattern Routing for TYPO3

Maintainers

👁 calien666

Package info

github.com/calien666/persisted-sanitized-routing

Type:typo3-cms-extension

pkg:composer/calien/persisted-sanitized-routing

Statistics

Installs: 2 448

Dependents: 0

Suggesters: 1

Stars: 1

Open Issues: 2

1.0.4 2022-04-07 09:51 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT ba336840c65997892089086318aad4b280eec7c3

  • Markus Hofmann <typo3.woop@calien.de>

routingtypo3

This package is auto-updated.

Last update: 2022-04-07 09:52:48 UTC


README

#Persisted sanitized pattern mapping

What does it do?

Enables the possibility generating sanitized URL parts from persisted patterns. The default PersistedPatternAspect takes e.g. database values and uses them "as they are", including umlauts, special characters and spaces, which will return them into your url and result in unexpected behaviours.

This PersistedSanitizedRoutingAspect encodes and decodes the database part and will make better readable URL parts.

How does it work?

Adds a new routing aspect extending the PersistedPatternMapper from TYPO3 core with sanitized URL parts.

aspects:
 country:
 type: PersistedSanitizedPatternMapper
 tableName: static_countries
 routeFieldPattern: '^(.*)-(?P<uid>\d+)$'
 routeFieldResult: '{cn_short_de|sanitized}-{uid}'
 localeMap:
 - locale: 'de_*'
 field: cn_short_de
 - locale: 'en_*'
 field: cn_short_en
 territory:
 type: PersistedSanitizedPatternMapper
 tableName: static_territories
 routeFieldPattern: '^(.*)-(?P<uid>\d+)$'
 routeFieldResult: '{tr_name_de|sanitized}-{uid}'
 localeMap:
 - locale: 'de_*'
 field: tr_name_de
 - locale: 'en_*'
 field: tr_name_en

As you can see, localization is respected, if needed.

Installation

Only install the extension and configure your persisted pattern mappers as described above fitting your needs. The |sanitized part will respect the field you want to sanitize.