Copied to clipboard

Flag this post as spam?

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


  • shine 43 posts 83 karma points
    May 21, 2013 @ 15:50
    shine
    0

    How to use direct current page namein xslt?

    Here is my code that i want to use direct Test page in my xslt but it did'n get any out put

    where is the problem in this syntax?

        <xsl:for-each select="$currentPage/ancestor-or-self::SiteRoot/ImageTest/imgcontent">
           
            <xsl:if test="$currentPage [name() = 'TEST']">
        {"url":"<xsl:value-of select="imagegallaery" />","width":"333","height":"249"}
        <xsl:if test="position() != last()">,</xsl:if>
            </xsl:if>
        </xsl:for-each>

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    May 21, 2013 @ 15:59
    Chriztian Steinmeier
    0

    Hi shine,

    When doing that, you're testing the XML element name (the Alias your document type gets) - if you're looking for the Name you give the page in Umbraco (i.e. what you see in the tree and on the Properties tab) use @nodeName :

    <xsl:for-each select="$currentPage/ancestor-or-self::SiteRoot/ImageTest/imgcontent">
    <xsl:if test="$currentPage[@nodeName = 'TEST']">
        {"url":"<xsl:value-of select="imagegallaery" />","width":"333","height":"249"}
        <xsl:if test="position() != last()">,</xsl:if>
    </xsl:if>
    </xsl:for-each>

    /Chriztian

  • shine 43 posts 83 karma points
    May 21, 2013 @ 16:07
    shine
    0

    hey chriztian

    TEST is my page name which is in my content of umbraco and i want to use direct name of content page in my xslt

Please Sign in or register to post replies

Write your reply to:

Draft