Macro inserted in RTE not rendered when using macro caching
Hi,
I am experiencing a problem with macro caching on a newly created v. 6.1.4 site running in WebForms mode. Here's my problem: I have one macro on the page called Document that basicly renderes everything within the <body> tag of the page, this macro renders an RTE property among others. I have created a few other macro's for use in the RTE (xslt search, contour etc). This all works fine. But when enable macro caching on my Document macro the macros inserted in the RTE field does not render anymore.
Is this a bug or is there some speciel way to render the RTE macro to make sure it's shown when using macro caching?
Taking wild guesses here, but I would assume that it's because when you "render" the RTE field, you're doing something smiliar to <xsl:value-of select="bodyText" disable-output-escaping="yes" />, right?
I think the actual macro parsing happens later, but when you use caching, this is probably skipped for some reason (could be a bug)...
I just had a chance to try out your solution. Unfortunately that didn't work either. Furthermore I just realised that no content is rendered at all when using umbraco.library:RenderMacroContent or umbraco.libray:Item and macro caching is turned on. If i just do a <xsl:value-of select="bodyText" disable-output-escaping="yes" /> the text in the RTE field is rendered but not the macro.
But for some odd reason that did not work, however when I put the content in a variable and then pass that variable into the RenderMacroContent method it worked as expected:
Macro inserted in RTE not rendered when using macro caching
Hi,
I am experiencing a problem with macro caching on a newly created v. 6.1.4 site running in WebForms mode.
Here's my problem:
I have one macro on the page called Document that basicly renderes everything within the <body> tag of the page, this macro renders an RTE property among others. I have created a few other macro's for use in the RTE (xslt search, contour etc). This all works fine. But when enable macro caching on my Document macro the macros inserted in the RTE field does not render anymore.
Is this a bug or is there some speciel way to render the RTE macro to make sure it's shown when using macro caching?
Any help will be greatly appreciated.
/Thor
Hi Thor,
Taking wild guesses here, but I would assume that it's because when you "render" the RTE field, you're doing something smiliar to
<xsl:value-of select="bodyText" disable-output-escaping="yes" />
, right?I think the actual macro parsing happens later, but when you use caching, this is probably skipped for some reason (could be a bug)...
What you can try is to use the
RenderMacroContent()
extension instead, like this:- which should render your RTE macros before the caching happens (I think :-).
Does this make sense?
/Chriztian
Hi Chriztian,
I am actually rendering it like this: <xsl:value-of select="umbraco.library:Item($currentPage/@id,'content')" />
I haven't tried out the RenderMacroContent method, so I will give that a try and report back :) - Thansk for the input
/Thor
Hi Chriztian,
I just had a chance to try out your solution. Unfortunately that didn't work either.
Furthermore I just realised that no content is rendered at all when using umbraco.library:RenderMacroContent or umbraco.libray:Item and macro caching is turned on. If i just do a <xsl:value-of select="bodyText" disable-output-escaping="yes" /> the text in the RTE field is rendered but not the macro.
Seems like it could be a bug.
/Thor
Hi Chriztian,
Just wanted to say that your solution worked! It was just me doing it wrong. Thanks for the help.
/Thor
Hello Thor,
Can you share your working solution ?
Prasanna
Sure thing Prasanna,
First i tried this:
But for some odd reason that did not work, however when I put the content in a variable and then pass that variable into the RenderMacroContent method it worked as expected:
Hope this helps.
/Thor
is working on a reply...