Copied to clipboard

Flag this post as spam?

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


  • Fengelz 106 posts 221 karma points
    Apr 12, 2010 @ 13:10
    Fengelz
    0

    Problem with umbraco.library:RenderTemplate?

    Hi for some reason this doesnt validate in the umbraco xslt editor in the backend:

    <xsl:template match="/">
        <xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']">
          <xsl:value-of disable-output-escaping="yes" select="umbraco.library:RenderTemplate(@id)"/>
        </xsl:for-each>
      </xsl:template>
    </xsl:stylesheet>

    but this does

    <xsl:template match="/">
        <xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']/node">
          <xsl:value-of disable-output-escaping="yes" select="umbraco.library:RenderTemplate(@id)"/>
        </xsl:for-each>
      </xsl:template>
    </xsl:stylesheet>

    The only difference is the lower example iteration ends with a '/node'.

    I changed the xslt manually in VS and it works fine. But when I try to edit via the backend i get the yellow notifyer saying "xslt could not be saved"

    Does anyone have an idea what could be causing this?

    The solution in question runs on umbraco v 4.0.2.1

    Cheers  

    Sune

  • Tommy Poulsen 514 posts 708 karma points
    Apr 12, 2010 @ 13:43
    Tommy Poulsen
    1

    Hi Sune, I'm not sure why you get different behavior in the 2 scenarios, but you may have to wrap the value-of ... RenderTemplate function in an if-statement testing that @id in not empty

    <xsl:if test="@id != ''">...
Please Sign in or register to post replies

Write your reply to:

Draft