Copied to clipboard

Flag this post as spam?

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


  • Bas Wensveen 54 posts 75 karma points
    Dec 04, 2009 @ 16:22
    Bas Wensveen
    0

    Passing a parameter xslt does not work

    All,

    Does anyone understand why the code below is not working? Somehow the content picker (pageLinkConsument) content is not passed to my xslt. The content picker does have a value, the otherwise clause is always evaluated no matter the value and Content picker is selected. I'm using  umbraco v 4.0.2.1 (Assembly version: 1.0.3441.17657)

    HTML file

    <a href="<umbraco:Macro Alias='PageNiceUrlForPageId' pageId='[#pageLinkConsument]' runat='server'></umbraco:Macro>" />

     

    XSLT file


     

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

       <xsl:template match="/">

          <xsl:variable name="pId" select="string(/macro/pageId)"/>

          <xsl:variable name="outUrl">
             <xsl:choose>
                <xsl:when test="$pId != '' and $pId != '0' and $pId != 'undefined'">
                   <xsl:value-of select="umbraco.library:NiceUrl($pId)"/>
                </xsl:when>
                <xsl:otherwise>
                   <!--<xsl:text>/</xsl:text>-->
                   <xsl:value-of select="$currentPage/data [@alias = 'pageLinkConsument']"/>
                </xsl:otherwise>
             </xsl:choose>
          </xsl:variable>

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

       </xsl:template>

     

  • Petr Snobelt 923 posts 1535 karma points
    Dec 04, 2009 @ 16:29
    Petr Snobelt
    1

    you can try add

    <textarea>

    <xsl:copy-of select="/macro" />

    </textarea>

    And check if it's passed to xslt.

    Maybe pageId is reserver parameter, try another name

  • Bas Wensveen 54 posts 75 karma points
    Dec 04, 2009 @ 16:44
    Bas Wensveen
    0

    I found it, I didn't create a parameter in the macro parameter screen of Umbraco.

     

    Shame on me! :-)

     

    Thanks Petr Snobelt

     

     

Please Sign in or register to post replies

Write your reply to:

Draft