Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Eddie Foreman 215 posts 288 karma points
    Aug 27, 2010 @ 00:08
    Eddie Foreman
    0

    umbraco.library is not defined

    Hi All

    Just trying to add HasAccess to a working xslt, but get an error that umbraco.library is not defined?  Seems to work well in other xslt but not this one?

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
    <!ENTITY nbsp "&#x00A0;">
    ]>
    <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ms="urn:schemas-microsoft-com:xslt"
    xmlns:umb="urn:umbraco.library"
    exclude-result-prefixes="ms umb">

    <xsl:output method="xml" omit-xml-declaration="yes" />

    <xsl:param name="currentPage" />
    <xsl:param name="root" select="$currentPage/ancestor-or-self::root" />
    <xsl:variable name="level" select="2" />

    <xsl:template match="/">
    <ul>
    <xsl:apply-templates select="$currentPage/ancestor-or-self::node [@level = $level] " />
    </ul>
    </xsl:template>

    <xsl:template match="node">
    <xsl:call-template name="test" />
    </xsl:template>

    <xsl:template name="test">
    <li>
    <a href="{umb:NiceUrl(@id)}">
    <xsl:if test="$currentPage/@id = current()/@id">
    <xsl:attribute name="class">select</xsl:attribute>
    </xsl:if>
    <xsl:if test="descendant::node[@id = $currentPage/@id]">
    <xsl:attribute name="class">active</xsl:attribute>
    </xsl:if>
    <xsl:value-of select="@nodeName"/>
    </a>
    <xsl:if test="descendant-or-self::node = $currentPage and node[data[@alias = 'umbracoNaviHide'] = 0 and (umbraco.library:HasAccess(@id, @path) = false())]">
    <ul>
    <xsl:apply-templates select="node" />
    </ul>
    </xsl:if>
    </li>
    </xsl:template>

    <xsl:template match="node[data[@alias = 'umbracoNaviHide'] = 1]" />


    </xsl:stylesheet>

    Using Umbraco 4.0.4.2

    Thanks

    Eddie

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Aug 27, 2010 @ 00:58
    Chriztian Steinmeier
    1

    Hi Eddie,

    You just need to use the prefix "umb" defined in the top of the file for the urn:umbraco.library namespace, so use umb:HasAccess() and all will be well.

    /Chriztian

  • Eddie Foreman 215 posts 288 karma points
    Aug 27, 2010 @ 08:50
    Eddie Foreman
    0

    Hi Chriztian

    Of course, all working

    Thanks

    Eddie

Please Sign in or register to post replies

Write your reply to:

Draft