I want to call XSLTsearch macro inside razor code.
The reason is:
I want to make the search results based on the culture
so, it should be something Like that:
@if (Culture == "en-US")
{
<form>
<umbraco:Macro runat="server" Alias="XSLTsearch"
// setting some parameters "not based on the condition"
// This Parameters based on condition result
searchFields="titleText_en, bodyText_en"
previewFields="titleText_en, bodyText_en">
</umbraco:Macro>
</form>
}
else
{
<form>
<umbraco:Macro runat="server" Alias="XSLTsearch"
// setting some parameters "not based on the condition"
// This Parameters based on condition result
searchFields="titleText, bodyText"
previewFields="titleText, bodyText">
</umbraco:Macro>
</form>
}
Invoke umbraco:Macro inside Razor
Hi,
I want to call XSLTsearch macro inside razor code.
The reason is:
I want to make the search results based on the culture
so, it should be something Like that:
-
Thanks in advance!
Hi,
It depends on if you are using MVC Razor (View, Partial View, Macro Partial View) or a legacy Razor Macro (DynamicNode).
For MVC, you can render any Macro from the Macro Engine with something similar to:
Full documentation here
For a legacy Razor Macro, you need to do something similar to this:
Jeavon
is working on a reply...