How to configure Pathauto with Transliteration
In this article we are going to build a system, which generates automatically URL aliases for new nodes and also transliterates them, So for example, our node "Test-äöü" would become "http://www.example.com/test-aou" .
What you need:
- Pathauto-module (this article uses 7.x-1.0-beta1)
- Token-module (7.x-1.0-beta1)
- Transliteration-module (7.x-3.0-alpha1)
- Path-module (included in the core)
As you can see, all the modules are still on beta- and alpha-stage, so in the future the installation may vary!
Installation
Before we begin, go to admin/modules and install the above modules.
First, we have to define the patterns for URL aliases. Go to admin/config/search/path/patterns. In most cases, the node titles are used in URLs, but you may input any tokens you like as URLs. Under "Content Paths", on the first field labeled "Default path pattern", type in [node:title]. On the same page, you can make custom URL patterns for different content types. For example, if you have Blog-content type, then in the "Pattern for all Blog paths" you can write f.ex. blog/[node:title], so your blog posts's URLs would be like http://example.com/blog/post-title. Under "Replacement Patterns", you can find all the patterns you can use. After you have made your changes, save your configuration.
The next step is to configure transliteration for the URLs. So go to admin/config/search/path/settings. Check the field "Transliterate prior to creating alias". Save your configuration afterwards.
Your URL aliases should now be configured! Try to make a new node and input some umlaut characters, like ä, å or Ü.
Other tips
If you want to override the automatic URL alias generation, go to node edit page and choose section "URL path settings". You can uncheck the "Automatic alias"-field and below that, manually type your own custom URL alias for that node.
Add new comment