DNNSkin.Net Blog

Stay up to date with our most recent news and updates

DDRMenu XSLT templates

DDRMenu XSLT templates

Oct 25 2013

This page describes how the DDRMenu XSLT template processor works. XSLT-based templates provide a good compromise of coverage and power, being supported in all versions of DotNetNuke and providing significantly more flexibility than token templates (although at the cost of extra complexity).

Table Of Contents

XML format»

The best way to see the XML structure provided to the XSLT stylesheet is to look at the output of the DumpXML template). For reference, the full set of attributes and elements of a menu is as follows

  • @id - The page ID
  • @text - The page name (i.e. what should normally be displayed in the menu)
  • @title - The full page title
  • @url - The page URL
  • @enabled - Whether the page is enabled
  • @selected - Whether the page is selected
  • @breadcrumb - Whether the page is in the current breadcrumb
  • @separator - Whether the node is a separator
  • @icon - The URL of the page icon
  • @largeimage - The URL of the large page icon (DNN 6 only)
  • @first - Whether the page is the first in its level
  • @last - Whether the page is the last in its level
  • @only - Whether the page is the only one in its level
  • @depth - The depth of the current page in the menu structure (starting at 0)
  • @commandname - The action command name (action menus only)
  • @commandargument - The action command argument (action menus only)
  • keywords - The keywords defined for the current page
  • description - The description of the current page
  • node - A child node of this node

Extension functions»

To access XSL extension functions, add a namespace reference to urn:ddrmenu to your stylesheet, e.g.

<xsl:stylesheet xmlns:ddr="urn:ddrmenu" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

This will give you access to the following functions:

  • UserIsInRole(roleName): returns true or false depending on whether the current user is in the specified role. e.g.
  • GetString(tokenName, resourceFile): returns a localised string (using the standard DotNetNuke Localization.GetString API). e.g.
    <xsl:value-of select="ddr:GetString('cmdCreate',<br />'admin/authentication/app_localresources/login.ascx.resx')">
    <xsl:value-of select="ddr:GetString('MyToken', 'MyCustom.resx')"></xsl:value-of></xsl:value-of>


A simple example might look like this:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">   <xsl:apply-templates select="root"> </xsl:apply-templates> 
    <xsl:apply-templates select="node"> </xsl:apply-templates>
  • first last selected <xsl:value-of select="@text"> </xsl:value-of> <xsl:value-of select="@text"> </xsl:value-of>
      <xsl:apply-templates select="node"> </xsl:apply-templates>
  • Search

    2013 Nov  46  1
    2013 Oct  495  4


    Win the First DotNetNuke Design Challenge for 2010 "Modern Web Standards" category, you can check more detail here Download winning Skin here

    Customize a personalized design for your business!

    We can provide professional DotNetNuke skin design and the W3C compliant skin.
    Make you 100% satisfaction, are the main characteristics of our work.

    © 2006-2014 by DNNSkin.Net, Inc. All rights reserved. Terms Of Use Privacy Statement