Better URLs for Scandinavian letters in N2CMS

Posted on 4 March 2012 and tagged with . Short link:

In N2CMS the default behavior when creating a page containing ‘Å’ or ‘Ö’ in the URL is to replace it with ‘Ae’ and ‘Oe’. I find this makes less readable URLs, and I believe people are more used to read URLs where you replace it with a single letter, e.g. ‘Å’ to ‘A’.

Example for page title “Räksmörgås”:
Default: raeksmoergas/
Wanted: raksmorgas/

To change this default behavior in N2CMS you need to add this configuration to Web.config:

<n2>
  <edit>
    <nameEditor>
      <replacements>
        <remove name="smallAE"/>
        <remove name="capitalAE"/>
        <remove name="smallOE"/>
        <remove name="capitalOE"/>
        <remove name="theRest"/>
 
        <add name="smallAE-new" pattern="[æä]" value="a" />
        <add name="capitalAE-new" pattern="[ÆÄ]" value="A" />
        <add name="smallOE-new" pattern="[ö]" value="o" />
        <add name="capitalOE-new" pattern="[Ö]" value="O" />
        <add name="theRest-new" pattern="[^. a-zA-Z0-9_-]" value="" />
      </replacements>
    </nameEditor>
  </edit>
</n2>
 

Comments (1)

Andrew - 26 February 2013 at 06:56 GMT - Link
Gravatar
Hi all I need an N2 CMS pro user to do some work on our website. My developer is great but got an offer from a big company to work full time. He has done a fantastic job of the site to date and I am really happy with the product but I need to keep adding functionality. Can someone recommend a solution?
You will have access to the existing developer and he will lead you through where we are up to to date.
Can you email me on info@rubysketch.com if you are interested.
Write a comment

Required: Login with OpenID to post a comment. It is quick, easy and safe

Name: *
Email:
(never displayed - used for Gravatar)
Website:
Message: * Allowed tags: b, i, a, code, pre, blockquote, strike