DotNetNuke DDRMenu : Outputting node not included in menu breadcrumb xslt dnn

1.6k Views Asked by At

I am having problems trying to get the following XSLT template for the DotNetNuke DDRMenu to spit out the last page/node of the breadcrumb for the following conditions:

  • the last page is NOT "Include(d) in the Menu" in its page settings
  • however the last page is a child of the the parent node (which does show up in my output)

How do I get the page not included in the menu to be outputted at the end of my breadcrumb from the following XSL template?:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html"/>
    <xsl:param name="separator"></xsl:param>
    <xsl:template match="/*">
        <xsl:apply-templates select="root" />
    </xsl:template>
    <xsl:template match="root">
        <ul>
            <xsl:apply-templates select="//node[@breadcrumb=1]" />
        </ul>
    </xsl:template>
    <xsl:template match="node">
        <li>
            <xsl:choose>
                <xsl:when test="@enabled = 1">
                    <a href="{@url}" title="{@title}">
                        <xsl:value-of select="@text" />
                    </a>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="@text" />
                </xsl:otherwise>
            </xsl:choose>
        </li>
    </xsl:template>
</xsl:stylesheet>
1

There are 1 best solutions below

0
On

I found out that my XSLT code is fine.

The problem was that my ascx skin object tag was missing an attribute setting to allow hidden pages to be output. Adding IncludeHidden="true" to the skin object tag fixed the problem.

Example below:

<ddr:MENU MenuStyle="breadcrumb" IncludeHidden="true" runat="server" />

This resource (http://www.dotnetnuke.com/Resources/Wiki/Page/DDRMenu-reference-guide.aspx#IncludeHidden_5) says:

IncludeHidden

For DotNetNuke 6 only, if set to "true", hidden pages will be included. This can be useful for creating separate menus to show site sections that are hidden from the main menu.