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?
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?
Yes, it's RenderMacroContent(). See the following for some guidance:
[url]http://en.wikibooks.org/wiki/Umbraco/Reference/umbraco.library/RenderMacroContent[/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.
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.
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
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.
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
(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.
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
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.
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.
is working on a reply...