Copied to clipboard

Flag this post as spam?

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


  • wilberRivera 24 posts 42 karma points
    Jul 09, 2010 @ 20:34
    wilberRivera
    0

    Pass parameter to related link's alias

    Hi everyone, I'm working in the related link's template, this starts with:

    <!-- Input the related links property alias here -->
      <xsl:variable name="propertyAlias" select="string('alias')"></xsl:variable>

    The question is: can I pass the 'alias' in a parameter from a macro? I try this:

    <!-- Input the related links property alias here -->
     <xsl:variable name="propertyAlias" select="/macro/linkAlias"></xsl:variable>

    but not works, can anyone help me?, thanks a lot.

  • Sascha Wolter 615 posts 1101 karma points
    Jul 09, 2010 @ 23:11
    Sascha Wolter
    0

    Don't see why this shouldn't work. Unfortunately I encounter some trouble from time to time as well when trying to pass in a parameter from a macro. Looks like some names are reserved and/or caching of the macro creates some temporary trouble. Have you

    - tried to add another parameter to the macro, e.g. like 'myParameter', of type text, and see how that works?

    - tried to ouput the content of the variable directly at the beginning of the '/' template? Do you at least get the passed in content, even if the related links don't work?

    If you get the parameter value through okay but the links are still not working try outputting the content of the data node for the alias, maybe explicitly converting the value to a string?

    <xsl:variable name="propertyAlias" select="string(/macro/myParameter)" />
    <xsl:template match="/">
    <xsl:value-of select="$propertyAlias" />
    node content:
    <xsl:copy-of select="$currentPage/data[@alias=$propertyAlias]" />
    ...
    </xsl:template>

     

    Sascha

Please Sign in or register to post replies

Write your reply to:

Draft