Copied to clipboard

Flag this post as spam?

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


  • Nik Wahlberg 639 posts 1237 karma points MVP
    Apr 06, 2009 @ 22:34
    Nik Wahlberg
    0

    Macro wierdness

    Hi all, I am experiencing something weird with including a macro in a RTE. I end up seeing the following in my HTML:

    [code] flashh="300" flashfile="1068" /> [/code]

    The output is a result of another XSLT, so I am guessing it has something to do with that. So, I am looping out a certain document type and it's RTE description which has embedded in it my flash macro. Effectively creating a nested macro scenario. Is this a problem? If so, how does one get around this?

    Thanks,
    Nik

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 06, 2009 @ 23:34
    Douglas Robar
    0

    You're on umbraco v3 (I can tell by the syntax) and will want to parse the bodyText to look for any UMBRACO_MACRO tags and either:

    a) remove it because it makes no sense in this context

    b) use the umbraco.library:RenderMacro() function to render it (remember that this will only work for rendering xslt macros not .net controls)

    cheers,
    doug.

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Apr 08, 2009 @ 17:37
    Nik Wahlberg
    0

    Hi Doug, thanks for the response, I didn't see it until today :(

    Actually this is v4.0.0. Should I still be looking to use the RenderMacro tag in v4?


    Hope all is well.

    Thanks,
    Nik

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 08, 2009 @ 20:44
    Douglas Robar
    0

    (All is well with me. Nice to see you on the forum again. You coming to CodeGarden '09? You should!!)

    You can use RenderMacro() in v4.0.0. Only RenderTemplate() is not available in v4.0.0 (though it is available in v3.x and v4.0.1 and up)

    cheers,
    doug.

  • nickspacek 26 posts 20 karma points
    Apr 20, 2009 @ 15:18
    nickspacek
    0

    I don't see RenderMacro() in the list of methods from umbraco.library, did you mean RenderMacroContent? I ask because I am having problems using RenderMacroContent to render a macro.

    Is there any way to render a user-control based macro from XSLT?

    Thanks,
    Nick

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Apr 20, 2009 @ 15:58
    Douglas Robar
    0

    Yes, it's RenderMacroContent(). See the following for some guidance:
    [url]http://en.wikibooks.org/wiki/Umbraco/Reference/umbraco.library/RenderMacroContent[/url]

    [url]http://forum.umbraco.org/yafpostst2671Help-with-RenderMacroContent.aspx[/url]

    [url]http://forum.umbraco.org/yafpostst2885RenderMacroContent--Help.aspx[/url]


    No, you can't render a .net-based macro from within XSLT. I think it has to do with the context of forms, session state, getting set to a string and not having the page.controls and handlers, etc. that .net needs and xslt doesn't handle. I think you might be able to go the other way around though (render xslt macro from .net macro), though I've never tried it myself.

    cheers,
    doug.

  • nickspacek 26 posts 20 karma points
    Apr 20, 2009 @ 16:11
    nickspacek
    0

    I did get it to render using the (old?) macro syntax in that article, rather than the umbraco:Macro syntax. But like you said, it doesn't work.

    I wish that there weren't these things that can only be done one way, but not the other. :) It's kind of confusing. It would be nice if this worked; if you can use an XSLT macro this way you should be able to use all macros this way. Oh well.

Please Sign in or register to post replies

Write your reply to:

Draft