Copied to clipboard

Flag this post as spam?

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


  • Dan Christoffersen 64 posts 119 karma points
    Jul 23, 2009 @ 11:30
    Dan Christoffersen
    0

    Getting attributes from the tag in the template?

    Is it possible to retrieve an attribute from the tag in the temlate and use it inside xslt?

    In the Template:

    <umbraco:Macro Alias="ShowCroppedImage" runat="server" size="LARGE"></umbraco:Macro>

    In the Xslt:

    <xsl:param name="size"/>

    Of course the 'size' parameter must be declared in the macro - or?

    Any way to achieve this?

     

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Jul 23, 2009 @ 11:36
    Sebastiaan Janssen
    100

    Yep, you should be able to just do:

    <xsl:value-of select="/macro/size" />
  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Jul 23, 2009 @ 12:42
    Morten Bock
    0

    To get the parameter passed, got to your macro, choose the "Parameters" tab, and add your size parameter as a string. Then you will be able to use it like Sebastiaan says.

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Jul 23, 2009 @ 13:05
    Sebastiaan Janssen
    0

    Ah thanks Morten, I kind of assumed that the parameter was there already.

  • 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