Copied to clipboard

Flag this post as spam?

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


  • hetaurhet 245 posts 267 karma points
    Sep 06, 2012 @ 11:41
    hetaurhet
    0

    not showing property value

    Hello

     

    I have xslt for breadcrum as follows in which I am using one property breadcrumbAlias to show text of beadcrumb.

    <?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="minLevel" select="1"/>

      <xsl:template match="/">

       <xsl:if test="$currentPage/@level &gt; $minLevel">
         <div id="breadcrumb"> <a href="/"></a> <img src="/images/breadcrumb_arrow.png" width="10" height="9" hspace="5" alt="breadcrumb"/>
            <xsl:for-each select="$currentPage/ancestor::*  [@level &gt; $minLevel and string(umbracoNaviHide) != '1']">
                <a href="{umbraco.library:NiceUrl(@id)}">
                  <xsl:value-of select="./breadcrumbAlias"/>
                </a>  <img src="/images/breadcrumb_arrow.png" width="10" height="9" hspace="5" alt="breadcrumb"/>
            </xsl:for-each>
            <b>
              <xsl:value-of select="./breadcrumbAlias" />
            </b>
          </div>
        </xsl:if>
      </xsl:template>
    </xsl:stylesheet>

    In this only current node property is not getting displayed. For loop works fine. But last line is not showing the text which should be shown in bold.

  • Drew 165 posts 340 karma points
    Sep 06, 2012 @ 11:45
    Drew
    0

    You can only use the "." identifier within a foreach loop, as it means "the current node", as you are with:

    <ahref="{umbraco.library:NiceUrl(@id)}">
                  <xsl:value-ofselect="./breadcrumbAlias"/>
     </a>


    When you're outside your foreach loop you'll need to use the $currentPage variable.

    So:
     

           </xsl:for-each>
            <b>
              <xsl:value-ofselect="$currentPage/breadcrumbAlias"/>
            </b>
          </div>
  • hetaurhet 245 posts 267 karma points
    Sep 06, 2012 @ 11:50
    hetaurhet
    0

    thx.. actually already tried this but I dont knw why it was not working...

    now it works...

Please Sign in or register to post replies

Write your reply to:

Draft