My logic is very simple. All I want is Display a .net usercontrol macro on basis of the current page. To apply this condition I need to use an xslt Macro. Following is my code.
The problem is, the usercontrol form is just rendered but not functioning. How do i get it to fire the page events/functions? Can any one suggest me a different logic I should apply here or is possible to use what is in xslt in the usercontrol as well?
Run UserControl Macro on specific pages
Hi guys,
My logic is very simple. All I want is Display a .net usercontrol macro on basis of the current page. To apply this condition I need to use an xslt Macro. Following is my code.
this goes in the Template-->>
<umbraco:Macro Alias="RegisterProjectsDiv" runat="server"></umbraco:Macro>
this goes in the xslt-->>RegisterProjectsDiv.xslt
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:variable name="eventsMacro" select="string('<?UMBRACO_MACRO
macroAlias="RegisterInterestForm" numberOfItems="2"
eventStartPage="1506"></?UMBRACO_MACRO>')"/>
<xsl:template match="/">
<xsl:if test="$currentPage/ancestor::*[@id = 1136]">
<div class="roundedpanel">
<a href="{umbraco.library:NiceUrl(1188)}">Register For Project of Interest</a>
<xsl:value-of select="umbraco.library:RenderMacroContent($eventsMacro, number($currentPage/@id))" disable-output-escaping="yes"/>
</div>
</xsl:if>
</xsl:template>
The problem is, the usercontrol form is just rendered but not functioning. How do i get it to fire the page events/functions? Can any one suggest me a different logic I should apply here or is possible to use what is in xslt in the usercontrol as well?
Thanks
TechoMan
Hey TechoMan,
Welcome to the fourm!
You can use the solution at the bottom of this post
http://our.umbraco.org/forum/templating/templates-and-document-types/15707-if-statement-on-masterpage?p=0#comment57895
Regards
Rich
Thanks Rich,
I will try now and reply.
Works Perfectly! Thanks Rich!
is working on a reply...