I have output the XML returned it is is correct, but has <?UMBRACO_MACRO macroAlias="Name" runat="server"></?UMBRACO_MACRO> and not <umbraco:Macro Alias="Name" runat="server"></umbraco:Macro>
That looks correct. Are these by chance .NET macros you are trying to render from XSLT? If so unfortunately that is not supported, pretty sure you can only render XSLT Macros from XSLT.
This *should* cause the macro to render but using data from the node 1234. However I'm not sure if you can pass that in dynamically or not, maybe you can with some inline C# NodeId='<%=something%>' ...
Using RenderMacroContent and MacroContainers on Umbraco v 4.7.1
Hi,
I am trying to use the RenderMacroContent on Umbraco v4.7.1 but it is not working:
This is my code:
<xsl:template match="/">
<xsl:variable name="data" select="umbraco.library:GetXmlNodeById(1129)"/>
<xsl:for-each select="$data">
<xsl:value-of select="umbraco.library:RenderMacroContent(./sidebarModules, ./@id)" disable-output-escaping="yes"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
I have output the XML returned it is is correct, but has <?UMBRACO_MACRO macroAlias="Name" runat="server"></?UMBRACO_MACRO> and not <umbraco:Macro Alias="Name" runat="server"></umbraco:Macro>
How do I get this working?
Many thanks,
Peter.
The XML returned is:
<?UMBRACO_MACRO macroalias="Macro1" /><?UMBRACO_MACRO macroalias="Macro2" />
So WHY is nothing output?
shouldn't it have runat="server"?
It should, but that is what the XML is output as?
Hi,
That looks correct. Are these by chance .NET macros you are trying to render from XSLT? If so unfortunately that is not supported, pretty sure you can only render XSLT Macros from XSLT.
-Tom
Hi Tom,
Yes, once of the modules inside the Macro Container is a .NET Macro
Basically what I'm trying to achieve is this:
I have a <umbraco:Item field="sidebarModules" recursive="true" runat="server" /> in the Master Template, however on the "DateFolder" pages,
I need to show the sidebarModules from another node.
sidebarModules is a Macro Container.
I don't know if there is an alternative solution to acheiveing this?
Peter.
Hmmm, that might be tricky.
One thing you could experiment with is the nodeId attribute on the <umbraco:Item tag, ex:
This *should* cause the macro to render but using data from the node 1234. However I'm not sure if you can pass that in dynamically or not, maybe you can with some inline C# NodeId='<%=something%>' ...
-Tom
Tom,
You're a star. Simply adding NodeID="xxx" worked :-)
is working on a reply...