Umbraco/Samples and Articles/Templates/URLsubstitution

From Wikibooks, open books for an open world
Jump to navigation Jump to search

What is it?[edit]

Umbraco URL's look like this:
You can make it to look like:
or even


  • You need to give an "easy to remember" link to the customer
  • Different charactersets.

The document name field by default is converted to an URL. If you have a document named "Странитса", it will be converted to an unacceptable link for www and the structure of your site will be broken.


  • For documents that need a new "link", the document type must be changed.

Add a new property with an alias umbracoUrlAlias, the property name is important. *incomplete - what sort of property (i.e.: label, tags, textstring)?*

  • Document now has a new field, where the URL alias can be written.

When substituting url's for several nodes, maybe even in full branch, you must type full ascending path, otherwise links will be broken.
Example: If you have the first subnode named Frontpage with UrlAlias Pagefront and its child Products with UrlAlias Items, type in Products page alias field:

Pagefront/Items (do not add .aspx)

Additional hints[edit]

  • Navigation

When you replaced the url to get new and working links and you use XSLT transformations for generating a site navigation or sitemap, modifications are needed in XSLT file. Look at the following sample how this could be done:

  <xsl:when test="data [@alias = 'umbracoUrlAlias'] != ''">
    <a href="{concat('/', data [@alias = 'umbracoUrlAlias'],'.aspx')}"><xsl:value-of
    <a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of