Copied to clipboard

Flag this post as spam?

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


  • Nite 9 posts 29 karma points
    Apr 20, 2011 @ 11:52
    Nite
    0

    breadcrumb

    hi everyone,

    i'm completely new to Umbraco, and as a designer i'm having a very hard time to understand XSLT and how it works. Anyway i need to create a breadcrumb which shows:

    Home > About Us > Who we are

    Till now i have managed to do the following:

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

      <xsl:param name="currentPage"/>

      <xsl:variable name="minLevel" select="1"/>
      <xsl:variable name="maxLevel" select="3"/>

      <xsl:template match="/">

        <xsl:if test="$currentPage/@level &gt; $minLevel">
          <ul class="breadcrumb">
            <xsl:for-each select="$currentPage/ancestor::* [@level &gt; $minLevel and @level &lt;= $maxLevel and string(umbracoNaviHide) != '1']">
              <li class="smlPathBx1">
                <a href="{umbraco.library:NiceUrl(@id)}">
                  <xsl:value-of select="@nodeName"/>
                </a>
              </li>
              <li class="smlPathBx2"></li>
            </xsl:for-each>
            <li class="smlPathBx3">
              <a href="{umbraco.library:NiceUrl(@id)}">
                  <xsl:value-of select="@nodeName"/>
              </a>
            </li>
            <li class="smlPathBx4"></li>
            <li class="smlPathBx5">
              <xsl:value-of select="$currentPage/@nodeName"/>
            </li>
            <li class="smlPathBx6"></li>
          </ul>
        </xsl:if>
      </xsl:template>
    </xsl:stylesheet>

    but i'm getting an "Error parsing XSLT file: \xslt\breadcrumb.xslt"

    can anyone help me on this please? :(

  • Bas Schouten 135 posts 233 karma points
    Apr 20, 2011 @ 11:59
    Bas Schouten
    0

    Hi ManU,

    If you create a new xslt in Umbraco its possible to select a XSLT template. It includes a default breadcrub script.

    <?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" xmlns:uQR="urn:uQR" xmlns:twitpic="urn:twitpic" xmlns:flickr="urn:flickr" xmlns:youtube="urn:youtube" xmlns:UCommentLibrary="urn:UCommentLibrary"
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets uQR twitpic flickr youtube UCommentLibrary ">

      <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">
          <ul>
            <xsl:for-each select="$currentPage/ancestor::* [@level &gt; $minLevel and string(umbracoNaviHide) != '1']">
              <li>
                <a href="{umbraco.library:NiceUrl(@id)}">
                  <xsl:value-of select="@nodeName"/>
                </a>
              </li>
            </xsl:for-each>
            <!-- print currentpage -->
            <li>
              <xsl:value-of select="$currentPage/@nodeName"/>
            </li>
          </ul>
        </xsl:if>
      </xsl:template>
    </xsl:stylesheet>
  • Nite 9 posts 29 karma points
    Apr 20, 2011 @ 12:03
    Nite
    0

    Hi Bas,

    dats what i used... but modified it a bit ...i'll try to do it again though

     

Please Sign in or register to post replies

Write your reply to:

Draft