Copied to clipboard

Flag this post as spam?

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


  • Stefan 117 posts 215 karma points
    Oct 29, 2009 @ 11:15
    Stefan
    0

    XSLTsearch and multiple websites

    Hi.

    I'm trying to get XSLTsearch working on my Umbraco installation with 2 seperate websites.

    When searching one of the sites, it will return the results of both.
    I'm using different templates, macro and xslt files.

    How can that be avoided?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Oct 29, 2009 @ 11:21
    Dirk De Grave
    1

    Stefan,

    there's some 'option' in the xslt which allows to specify where to start searching. Assuming you've got a root node for each of the websites, it should be easy to pass the id of the root node of the website to search.

    Look for the 'source' parameter in the macro, should be set to the root node! If not set, xslt search assumes you'll be searching the complete content tree (node = -1)

    Hope this helps.

    Regards,

    /Dirk

  • Stefan 117 posts 215 karma points
    Oct 29, 2009 @ 12:13
    Stefan
    0

    Thanks a lot! It's working now - but I still had some trouble.

    I thought it would be wise to add 2 different doc-types (of XSLTsearch) and then make one template containing the macro (for different settings) for each website, but for some reason it did not recognize the settings passed from the macro in the template for the "new" doc-type I added.

    Now I have only one doc-type which allows two templates - one for each side. The downside of this is that the users now can pick a wrong template?
    Unless I make the users unable to browse the searchpage.

    Is this the best way of doing it?

  • Mark 3 posts 23 karma points
    Mar 29, 2011 @ 04:13
    Mark
    0

    I changed the source to <xsl:variable name="source" select="-1" /> and the search is still searching all sites.

     

Please Sign in or register to post replies

Write your reply to:

Draft