Copied to clipboard

Flag this post as spam?

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


  • Brett Davis 5 posts 25 karma points
    Apr 23, 2012 @ 00:36
    Brett Davis
    0

    XSLT Help on writing a macro to display current folder name

    This is how I've got my site set up:

    Home

    - Sub Folder 1

    - Sub Folder 2

    - Sub Folder 3

    --Sub Page 2

    --Sub Page 3

     

    When I'm on Sub Page 2 and Sub Page 3, my macro will display Sub Folder 3. When I'm on Sub Folder 3, I'd like it to say Sub Folder 3, unfortunately it says Home.

    Does anyone have any suggestions?

  • Brett Davis 5 posts 25 karma points
    Apr 23, 2012 @ 00:38
    Brett Davis
    0

    Just to be clear, Sub Page 2 and Sub Page 3 are under Sub Folder 3.

  • LordToro 9 posts 29 karma points
    Apr 25, 2012 @ 12:50
    LordToro
    0

    I assume text in bracket is document type.

    Home (Home)

    - Sub Folder 1 (subFolder)

    - Sub Folder 2  (subFolder)

    - Sub Folder 3  (subFolder)

    --Sub Page 2  (subPage)

    --Sub Page 3  ( subPage)

    And  let's try this one:

       <xsl:choose>

          <xsl:when test="name($currentPage) = 'subFolder'">

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

          </xsl:when>

          <xsl:when test="name($currentPage) = 'subPage'">

            <xsl:value-of select="$currentPage/parent::* /@nodeName"></xsl:value-of>

          </xsl:when>

        </xsl:choose>

Please Sign in or register to post replies

Write your reply to:

Draft