Copied to clipboard

Flag this post as spam?

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


  • Milen Kovachev 13 posts 33 karma points
    Mar 25, 2011 @ 18:04
    Milen Kovachev
    0

    Is it possible to use xslt elements in inline xslt?

    Hi Everyone,

    I am trying something, which I am not sure is possible with inline xslt.

    I would like to test the value of a page field and based on that output certain html. For example:

    <umbraco:Item runat="server" field="useSimpleHeader" xslt="<xsl:if test='{0}=1'/>ablablablalbalalbalab</xsl:if>" xsltDisableEscaping="true"/>


    But whatever xslt element I try to put in the xslt tag, it seems that it is not taken into consideration.

    Is it possible to do that at all?

    Thanks

  • Daniel Bardi 927 posts 2562 karma points
    Mar 25, 2011 @ 18:23
    Daniel Bardi
    0

    You can't use it that way.

    Why not just create a macro?

  • Milen Kovachev 13 posts 33 karma points
    Mar 26, 2011 @ 23:01
    Milen Kovachev
    0

    Hi Daniel,

    Thanks for letting me know.

    I already had a macro but wanted to explore my options.

  • Rich Green 2246 posts 4008 karma points
    Mar 27, 2011 @ 09:28
    Rich Green
    1

    Just so you know as your exploring your options, you could do this inline with Razor.

    http://umbraco.com/help-and-support/video-tutorials/umbraco-fundamentals/razor/inline-razor-script

    Rich

  • Daniel Bardi 927 posts 2562 karma points
    Mar 27, 2011 @ 11:54
    Daniel Bardi
    0

    @Rich: Great answer.. forgot about Razor as an option..

  • Kim Andersen 1447 posts 2197 karma points MVP
    Mar 27, 2011 @ 15:44
    Kim Andersen
    0

    Hi Milen

    You can read some more about inline xslt in this wiki: http://our.umbraco.org/wiki/reference/templates/umbracoitem-element/inline-xslt

    But the Razor option is also a great oportunity.

    /Kim A

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies