Hi Goncalo (Sorry, don't know how to make the special characters to spell your name 100% correct) and welcome to our :)
Why are you trying to render the XSLT macro from a Razor based macro? What is your scenario? And could there perhaps be another way around it?
Sounds like you should just output the XSLT macro directly in a template instead of a macro - And if not then just fetch the needed button value using your Razor macro?
Ok, but I suggest that you keep them seperate instead of trying to mix them. It's begging for trouble and time-wasting and I'm not sure it can be done.
Instead of spending the time doing that I think you're better of by just fetching what you need in the header by using Razor, which it's already using :)
Yup exactly, it something that does not make sense anyway so it's better to just use the proper method for the job and move on to new and more rewarding challenges :)
But please by all means feel free to ask for help if you get stuck with anything once again.
RenderMacroContent renders raw HTML
Hey guys,
I'm new to Umbraco6, and I am trying to call a xslt macro into a razor file.
This is what my code looks like:
@using System.Web
@using System.Web.Mvc
@using System.Web.Security
@using umbraco.MacroEngines
<div id="renewButtonContainer">
@umbraco.library.RenderMacroContent("<?UMBRACO_MACRO macroAlias=\"RenewSubscriptionButton\" ></?UMBRACO_MACRO>", Model.Id)
</div>
The output of this is the following:
<div class="renewButton">
<a href="#"><xsl:value-of select="$renewButton" /></a>
</div>
instead of the actual "button"...
I've tried to use the "@Html.Raw(umbraco.library.....) method, but it didn't worked...
Thank you in advanced
Hi Goncalo (Sorry, don't know how to make the special characters to spell your name 100% correct) and welcome to our :)
Why are you trying to render the XSLT macro from a Razor based macro? What is your scenario? And could there perhaps be another way around it?
Sounds like you should just output the XSLT macro directly in a template instead of a macro - And if not then just fetch the needed button value using your Razor macro?
Looking forward to hearing from you.
Cheers, Jan
Hey Jan, Thank you for your anwser!
Well, I have used this XSLT macro in other pages, so I thought that I could use it in the header of the page, wich is coded in razor.
The project manager gave me this chalenge, since I am still learning my way around Umbraco and XSLT...
Hi Gonçalo
Ok, but I suggest that you keep them seperate instead of trying to mix them. It's begging for trouble and time-wasting and I'm not sure it can be done.
Instead of spending the time doing that I think you're better of by just fetching what you need in the header by using Razor, which it's already using :)
Cheers, Jan
Hey Jan,
So I decided to render the button using only razor... It just not worth the effort...
Oh well... New challenges await... Thank you so much for your help!
Hi Gonçalo
Yup exactly, it something that does not make sense anyway so it's better to just use the proper method for the job and move on to new and more rewarding challenges :)
But please by all means feel free to ask for help if you get stuck with anything once again.
Have fun Umbracoing!
Cheers, Jan
is working on a reply...