Archive for the 'config' Category

/config/xsltExtensions.config 3

Another config file (check here for /config/Dashboard.config) that can be found in the /config folder of umbraco is the xslExtensions.config.

This file can be used to setup custom xslt extensions.

If you are not familiar with xslt extensions here is a brief intro:

With xslt extensions you can call static .net methods from xslt.

When editing an xslt file and inserting a value.


You get the option to “get extensions”.


Hitting the button will display a new modal that will list all xslt extensions and their methods.

Default umbraco has a couple of xslt extensions .


The most used one would probably be umbraco.library:NiceUrl(Int32 nodeID) , this takes a node id and will output the url of that node.



Using /config/xslExtensions.config you can also add custom xslt extensions.

Lets look at an example, the blog package for umbraco 4 comes with an xslt extension to get the gravatar image based on an email address.

So step 1 is to write the .net code that can be used. This is just a static method.


using System;
using System.Collections.Generic;
using System.Web;
namespace Umlaut.Umb.Blog
    public class BlogLibrary
        /// <summary>
        /// Gets the gravatar.
        /// </summary>
        /// <param name=”email”>The email.</param>
        /// <param name=”size”>The size.</param>
        /// <param name=”defaultImage”>The default image.</param>
        /// <returns></returns>
        public static string getGravatar(string email, int size, string defaultImage)
            System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
            byte[] result = md5.ComputeHash(System.Text.Encoding.ASCII.GetBytes(email));
            System.Text.StringBuilder hash = new System.Text.StringBuilder();
            for (int i = 0; i < result.Length; i++)
            System.Text.StringBuilder image = new System.Text.StringBuilder();
            image.Append(“gravatar_id=” + hash.ToString());
            image.Append(“&amp;size=” + size.ToString());
            return image.ToString();


Next step (after dropping the assembly in the bin) is to setup the xslExtensions.config file.

<?xml version=”1.0″ encoding=”utf-8″?>
  <ext assembly=”\bin\Umlaut.Umb.Blog” type=”Umlaut.Umb.Blog.BlogLibrary” alias=”BlogLibrary”>

So you need a new ‘ext’ node with the following attributes:

  • assembly
  • type
  • alias

If the settings are correct it should appear (with the alias setup in the config file) in the xslt extensions modal


Last thing todo before you can use it is to declare the namespace.

    exclude-result-prefixes=”msxml umbraco.library BlogLibrary”>

Enabling the script editor 3

This feature was introduced at codegarden 07 as a new feature in v3 but is was disabled in the release because of some issues with cross browser compatibility ( and maybe other bugs, …). I noticed that it works fine in firefox but don’t use it with ie.





Just locate the



In the config\umbracoSettings.config file and change it to false.

/Config/Dashboard.config 4

Just posted this on the forum and I thought I could do a quick post about the umbraco dashboard.config file.

When you log in the the umbraco backend or when you enter a section, the right side of the umbrao backend will be empty


You can fill up these ‘dashboards’ with tab pages that contain usercontrols.

How do you do this ? You will have to edit the /config/dashboard.config file.

Default the dashboard.config file looks like this:

<?xml version=”1.0″ encoding=”utf-8″ ?> 
    <tab caption=”Last Edits”>
    <tab caption=”Latest Items”>
    <tab caption=”Create blog post”>


So to add a usercontrol to th content area we should add this:

<?xml version=”1.0″ encoding=”utf-8″ ?> 
    <tab caption=”Last Edits”>