Copied to clipboard

Flag this post as spam?

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


  • Lee 95 posts 115 karma points
    Nov 23, 2013 @ 14:53
    Lee
    0

    can't access property of currentPage

    Hi

    I haven't worked in Umbraco for a long time, but I have forgotten how to access a property of a node. So I have a node set up with the property 'hideHospitalNumber' attached.

    I am using the code below to test if the 'hideHospitalNumber value but it is 0 or 1.

    Could someone please take a look?

     

    Many thanks

     

     

     

    <?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:msxml="urn:schemas-microsoft-com:xslt"

    xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" 

    exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">

     

     

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

     

    <xsl:param name="currentPage"/>

    <xsl:variable name="source" select="$currentPage/serviceContentSource"/>

    <xsl:template match="/">

    <xsl:value-of select="$currentPage"/>

    <xsl:choose>

    <xsl:when test="$currentPage/serviceContentSource != ''">

    <div class="tel">

    <ul>

    <xsl:if test="umbraco.library:GetXmlNodeById($source)/hideHospitalNumber = '0'">

    <li><a href=""><b>Hospital and Referrals</b><br/>Tel: +44 (0)1638 782020<br/>[email protected]</a></li>

    </xsl:if>

    <xsl:if test="umbraco.library:GetXmlNodeById($source)/hideEquineNumber = '0'">

    <li><a href="£"><b>Equine Practice</b><br/>Tel: +44 (0)1638 782000<br/>[email protected]</a></li>

    </xsl:if>

    <xsl:if test="umbraco.library:GetXmlNodeById($source)/hideLabNumber = '0'">

    <li><a href="£"><b>Lab</b><br/>Tel: +44 (0)1638 782050<br/>[email protected]</a></li>

    </xsl:if>

    </ul>

    </div>

    </xsl:when>

    <xsl:otherwise>

     

    <div class="tel">

    <ul>

    <xsl:if test="$currentPage/hideHospitalNumber = '0'">

    <li><a href=""><b>Hospital and Referrals</b><br/>Tel: +44 (0)1638 782020<br/>[email protected]</a></li>

    </xsl:if>

    <xsl:if test="$currentPage/hideEquineNumber = '0'">

    <li><a href="£"><b>Equine Practice</b><br/>Tel: +44 (0)1638 782000<br/>[email protected]</a></li>

    </xsl:if>

    <xsl:if test="$currentPage/hideLabNumber = '0'">

    <li><a href="£"><b>Lab</b><br/>Tel: +44 (0)1638 782050<br/>[email protected]</a></li>

    </xsl:if>

    </ul>

    </div>

    </xsl:otherwise>

    </xsl:choose>

    </xsl:template>

    </xsl:stylesheet>

  • Lee 95 posts 115 karma points
    Nov 23, 2013 @ 14:54
    Lee
    0

    sorry, posted in wrong catagory!

Please Sign in or register to post replies

Write your reply to:

Draft