Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • TENNO 13 posts 73 karma points
    Nov 10, 2013 @ 09:30
    TENNO
    0

    Invoke XSLTsearch Macro inside Razor code

    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:

    @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>
    }
    

    -

    Thanks in advance!

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Nov 11, 2013 @ 09:12
    Chriztian Steinmeier
    0

    Hi TENNO,

    What are the specifics you want to change?

    You may be able to just change them in the XSLTseach macro itself... e.g., the culture is usually determined by the topnode in the "current" site, so XSLTsearch can easily search only pages in the current language/site.

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft