Copied to clipboard

Flag this post as spam?

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


  • Frederik T 221 posts 331 karma points
    Sep 29, 2011 @ 14:13
    Frederik T
    0

    if script block statement in template, checking output from xslt macro

    Ok, dont know if this is impossible from the get go, but it doesnt hurt to ask.

    Ive looked around on how to do if statements in a template like here for example:
    http://our.umbraco.org/forum/templating/templates-and-document-types/18997-if-statement-in-template-file

    and here

    http://our.umbraco.org/forum/templating/templates-and-document-types/7376-Is-it-possible-to-use-if-statement-in-templates

    I have this macro that outputs a number from 0 to 7. If the number is above 0, a specific macro has to be used, if its 0 another has to be used.

    I know its easy peasy to do in xslt, but sadly this is just not possible in the current situation, as im forced to use multiple macros.

    Is it doable or do i have to find another way?

  • Rodion Novoselov 694 posts 859 karma points
    Sep 29, 2011 @ 17:44
    Rodion Novoselov
    1

    I suspect that the only possible solution to this is to create an instance of the macro control in the code by hand, render it to the memory stream and then extract the rendered value to use it.

  • Frederik T 221 posts 331 karma points
    Sep 29, 2011 @ 17:54
    Frederik T
    0

    Yeah, in the meantime i figured it wouldnt work the way i wanted it to. Had to force the backend to add some more functionality to the usercontrol and a bit of dirty coding. Thank you for your time anyway, i appreciate it :)

  • 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