Are you inserting the macro into a Rich Text Editor, and calling the RTE's contents from another Macro?
If so you need to wrap it in the umbraco.library:RenderMacroContent(content, pageid) function to make sure the macros render. This is done automatically in templates but if you are calling an RTE from a macro you need to handle it manually:
My Tab Content: <xsl:value-of select="umbraco.library:RenderMacroContent($currentPage/yourRteField, $currentPage/@id)"/>
That's fine - the RenderMacroContent function will render your RTE's contents like normal, and if it finds a macro inserted it will also render that. So even if you don't have a macro in your RTE it's safe to use.
You would replace wherever your current code is calling the RTE with the above. Also I forgot to add, make sure to include disable-output-escaping="yes" like you would normally do.
If you are getting that output, you should be able to wrap whatever code is producing that output int he RenderMacroContent function, and that (should) transform the <?UMBRACO_MACRO tags into the actual output of the macro. I would need to see your code that outputs that to show how you would add it.
However I just realized something, according to a recent post by Dirk you can't use RenderMacroContent for a user-control macro, which I think the RenderForm macro is. It looks like it might not be possible to render a Contour form from XSLT according to this post...not sure if there are any alternatives.
Unfortunately it looks like it might not be possible to render a Contour form from an XSLT macro, due to the fact that RenderMacroContent does not work with usercontrol macros - see this thread for more details
Render contour form inside macro
Hello,
I am using a macro to display some tabs on my page. Inside this tabs i want to add a umbraco contour form. If i do so i get a
<?UMBRACO_MACRO
inside my code. Is there a way to render this macro correct?
If i use a normal template it works but it should also be rendered inside my macro
Anybody any solution for it?
Are you inserting the macro into a Rich Text Editor, and calling the RTE's contents from another Macro?
If so you need to wrap it in the umbraco.library:RenderMacroContent(content, pageid) function to make sure the macros render. This is done automatically in templates but if you are calling an RTE from a macro you need to handle it manually:
-Tom
Ok so where i have to paste this code into? the macro is not always there - only on some specific pages
I ve got dynamic tabs which are generated via xslt - in these tabs i sometimes need to add a contour form (with RTE macro plugin).
Thanks
That's fine - the RenderMacroContent function will render your RTE's contents like normal, and if it finds a macro inserted it will also render that. So even if you don't have a macro in your RTE it's safe to use.
You would replace wherever your current code is calling the RTE with the above. Also I forgot to add, make sure to include disable-output-escaping="yes" like you would normally do.
so what i have until now is:
<xsl:value-of select="umbraco.library:RenderMacroContent($currentPage/contentTab3Text, $currentPage/@id)" disable-output-escaping="yes" />
contentTab3Text is the conten of tab3 and inside it i want to place my contour form with alias umbracoContour.RenderForm
If I use
<xsl:value-of select="umbraco.library:RenderMacroContent($currentPage/umbracoContour.RenderForm, $currentPage/@id)" disable-output-escaping="yes" />
it is not working - only on first tab this works on each other tab i get an previous - next button :)
Are you inserting the form into the RTE or are you wanting to use a form picker? What exactly is umbracoContour.RenderForm?
Yes i am using the normal contour macro formpicker. And umbracoContour.RenderForm is the alias of the macro (default contour setting)
What code were you using in your original post that outputted the <?UMBRACO_MACRO text? You should be able to just wrap this in the RenderMacroContent
i just add one contour form with RTE into my tab usercontrol and in the page source i see this <?UMBRACO_MACRO
I think it is not rendered in the correct way
If you are getting that output, you should be able to wrap whatever code is producing that output int he RenderMacroContent function, and that (should) transform the <?UMBRACO_MACRO tags into the actual output of the macro. I would need to see your code that outputs that to show how you would add it.
However I just realized something, according to a recent post by Dirk you can't use RenderMacroContent for a user-control macro, which I think the RenderForm macro is. It looks like it might not be possible to render a Contour form from XSLT according to this post...not sure if there are any alternatives.
SO inside my template i include my xslt macro which displays the tabs :
<umbraco:Macro Alias="ContentTabs" runat="server"></umbraco:Macro>
Inside this XSLT macro i want to display the contour form in the tab the user has put it into:
<xsl:if test="$currentPage/contentTab2Headline != '' ">
<div style="display: none;" class="tab" id="tab2">
<xsl:value-of select="umbraco.library:RenderMacroContent($currentPage/contentTab2Text, $currentPage/@id)" disable-output-escaping="yes" />
</div>
</xsl:if>
<xsl:if test="$currentPage/contentTab3Headline != '' ">
<div style="display: none;" class="tab" id="tab3">
<xsl:value-of select="umbraco.library:RenderMacroContent($currentPage/contentTab3Text, $currentPage/@id)" disable-output-escaping="yes" />
</div>
</xsl:if>
contentTab2Text and contentTab3Text are the content RTE content sections of the editor where i added the contour form.
But it is not displaying the contour forms in the tabs
Hi Dominik,
Unfortunately it looks like it might not be possible to render a Contour form from an XSLT macro, due to the fact that RenderMacroContent does not work with usercontrol macros - see this thread for more details
-Tom
Yes and how can i now solve this issue? is there any solution for it?
is working on a reply...