Ok, I have an XSLT file that has my "bodyText" property in it. In my bodyText RTE, I have inserted a macro. Since my bodyText property is inside my XSLT file and not directly inside of my Template, there is an issue with rendering the Macro through the RTE. I thought there was some sort of solution using the umbraco.library.RenderMacroControl. But I am not quite sure.
There's some pitfall however related to caching - there's been a discussion here recently about it that you can try to find by search if you're interesting. Nevertheless without caching this method seems to work all right.
That actually outputted the same <?UMBRACO_MACRO macroAlias="CateringAndEvents" />. Did the same thing as the RenderMacroContent. It may be something else. For some reason it is working on other pages, but not on this particular one. Specifically the specific doctype.
This is my full XSLT. It looks like it is trying to output the macro but is actually spitting out the Umbraco MACRO string or output. Not sure why.
Master template is the same as the current template. It would cause an endless loop! Make sure that the current template ''Template with id: '-1' has another Master Template than itself. You can change this in the template editor under 'Settings'
Nevermind - it's a strange error that happens sometimes (I don't know why but I haven't seen any problem with it - probably it's just a bug). Back to the macro - try to check what's the raw value of the bodyText (inside umbraco.config and particulary of course this <?UMBRACO_MACRO ...> tag) - some idea is flying around that it might look down there not as expected...
Yeh, there is nothing really out of the ordinary. I can see the tag of <?UMBRACO_MACRO ...> We have a few other ones using a simlar syntax but they are rendering fine on the other pages. I will not worry about it for right now. I will try a few different things. I am not sure why this one is having some issues. Might be on my end.
Macro inside RTE, pulling through XSLT
Ok, I have an XSLT file that has my "bodyText" property in it. In my bodyText RTE, I have inserted a macro. Since my bodyText property is inside my XSLT file and not directly inside of my Template, there is an issue with rendering the Macro through the RTE. I thought there was some sort of solution using the umbraco.library.RenderMacroControl. But I am not quite sure.
Is there a way to do this? Thanks.
Ok I found an option for my issue, it works on one of the pages I am using
<xsl:variable name="content" select="umbraco.library:GetXmlNodeCurrent()/bodyText"/>
<xsl:value-of select="umbraco.library:RenderMacroContent($content, umbraco.library:GetXmlNodeCurrent()/@id)" disable-output-escaping="yes"/>
One of my pages is showing <?UMBRACO_MACRO macroAlias="CateringAndEvents" />
Any ideas? Thanks
Hi. You need to use the library.Item(...) method that ensures handling macros embeded into the bodyText or other RTE properties. E.g.:
There's some pitfall however related to caching - there's been a discussion here recently about it that you can try to find by search if you're interesting. Nevertheless without caching this method seems to work all right.
Ok I found an option for my issue, it works on one of the pages I am using
<xsl:variable name="content" select="umbraco.library:GetXmlNodeCurrent()/bodyText"/>
<xsl:value-of select="umbraco.library:RenderMacroContent($content, umbraco.library:GetXmlNodeCurrent()/@id)" disable-output-escaping="yes"/>
One of my pages is showing <?UMBRACO_MACRO macroAlias="CateringAndEvents" />
Any ideas? Thanks
@Rodion,
That actually outputted the same <?UMBRACO_MACRO macroAlias="CateringAndEvents" />. Did the same thing as the RenderMacroContent. It may be something else. For some reason it is working on other pages, but not on this particular one. Specifically the specific doctype.
This is my full XSLT. It looks like it is trying to output the macro but is actually spitting out the Umbraco MACRO string or output. Not sure why.
<xsl:when test="umbraco.library:GetXmlNodeCurrent()/@nodeType = 1140 or
umbraco.library:GetXmlNodeCurrent()/@nodeType = 1143 or
umbraco.library:GetXmlNodeCurrent()/@nodeType = 1488
">
<xsl:call-template name="mobileBackHomeNavBar" />
<xsl:call-template name="generalPageHeader" />
<xsl:value-of select="umbraco.library:GetXmlNodeCurrent()/pageSubHeader"/>
<div id="allContent">
<div>
<xsl:call-template name="mobileGeneralMediaHolder" />
</div>
<xsl:value-of select="umbraco.library:Item(@id, 'bodyText')" disable-output-escaping="yes"/>
</div>
</xsl:when>
Hmmm. Is there any unusual with "bla-bla-bla.aspx?umbDebugShowTrace=true" ?
I tried that. Do I need to turn something on in a .config to get the debug trace?
Yep. I may have found something in Red
Master template is the same as the current template. It would cause an endless loop! Make sure that the current template ''Template with id: '-1' has another Master Template than itself. You can change this in the template editor under 'Settings'
that is all I found though
Nevermind - it's a strange error that happens sometimes (I don't know why but I haven't seen any problem with it - probably it's just a bug). Back to the macro - try to check what's the raw value of the bodyText (inside umbraco.config and particulary of course this <?UMBRACO_MACRO ...> tag) - some idea is flying around that it might look down there not as expected...
Yeh, there is nothing really out of the ordinary. I can see the tag of <?UMBRACO_MACRO ...> We have a few other ones using a simlar syntax but they are rendering fine on the other pages. I will not worry about it for right now. I will try a few different things. I am not sure why this one is having some issues. Might be on my end.
Thanks for the help!
I know what I did. I completely bypassed the checking off of the macro to use in editor.
I just assumed taking some other code and plugging it in the RTE would work. This is user/developer error.
I feel not so smart. But I found out why though.
Nevermind, I am still wrong. Still doing the same thing. Oh well. I am not too concerned about it right now.
is working on a reply...