Does anyone know if it's possible to 'inject' a XSLT macro (say for navigation) into a Razor macro. ie Call and inject the results of the xslt macro into the output of a razor one. This isn't something that i've attempted yet so I've got no example code just wondered if it's possible.
Basically I'm using a razor login control and then depending on whether a user is logged in or not I want to show/hide the sitemap which has been written in xlst :)
i would try a rewrite to sitemap in razor. It really depends on your requirment. But you do not want to start mixing XSLT and razor markup. You will come acroos a whole heap of omplications further down the line :). Charlie
In your Sitemap you should be able to add the logic to handle if a user is logged in or not.
There are some XSLT extensions that deals with that - if you are using the "built in" XSLT snippet for creating a Sitemap it's actually already handled using the umbraco.library:IsLoggedOn() extension.
You can't mix Razor and XSLT - Even if you could it would be spaghetti...spaghetti tastes good but it's not something you want in your code :)
Injecting XSLT in CSHTML
Hi Folks,
Does anyone know if it's possible to 'inject' a XSLT macro (say for navigation) into a Razor macro. ie Call and inject the results of the xslt macro into the output of a razor one. This isn't something that i've attempted yet so I've got no example code just wondered if it's possible.
I'm using Umbraco 4.9.
Thanks in advance,
Craig
Hi, out of intrest why are you trying to do this? Charles :)
Basically I'm using a razor login control and then depending on whether a user is logged in or not I want to show/hide the sitemap which has been written in xlst :)
i would try a rewrite to sitemap in razor. It really depends on your requirment. But you do not want to start mixing XSLT and razor markup. You will come acroos a whole heap of omplications further down the line :). Charlie
Hi Craig
In your Sitemap you should be able to add the logic to handle if a user is logged in or not.
There are some XSLT extensions that deals with that - if you are using the "built in" XSLT snippet for creating a Sitemap it's actually already handled using the umbraco.library:IsLoggedOn() extension.
You can't mix Razor and XSLT - Even if you could it would be spaghetti...spaghetti tastes good but it's not something you want in your code :)
Hope this helps.
/Jan
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.