Project: URL alias name pattern
Table of contents:
Compatibility
The issue described in this article has been addressed in eZ publish 3.10.
The patches described are for eZ publish3.10/3.9/(possibly before) respectively.
Users of eZ Publish 3.10 or greater can simply take advantage of this feature right out of the box.
Current situation
Before eZ Publish 3.10, the object name pattern which you can specify in the content class is also used to create the nice url's. Sometimes this is not really what you want:
- clients don't keep the titles at a reasonable size
- you use a special character set, of which the characters are not supported in the url
What this patch does
This patch adds a second name pattern to the content class, which is used to create the nice url's. If you don't fill in the URL alias name pattern, the system falls back to the object name pattern. Actually it's quite similar to the "post slug" feature in Wordpress. The patch was merged into the eZ Publish core for version 3.10.0alpha1 and is a standard feature now.
There are other ways to circumvent the issues described above, like using the rule based transformation of characters by the eZCharTransform class, which can be configured in transform.ini. But I only discovered this possibility after making this patch.
Installation
You can download the patched files from the pubsvn community repository.
You can just copy the files for your major eZ publish version from the patches directory over the original files of your eZ publish installation. Make sure you backup the original files first. Afterwards, run the SQL in patches/dbschema.sql on your eZ publish database.
Further readings
If you want to go further and affect the way used name is cleaned up for usage in the url, then have a look at the transliteration system.