Copied to clipboard

Flag this post as spam?

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


  • MartinB 411 posts 512 karma points
    Nov 13, 2010 @ 22:02
    MartinB
    0

    Using XSLTsearch on two websites in Umbraco

    Hi Douglas

    Great package!

    How do i go about using it for two different sites in the same umbraco solution? Right now i have an issue where the search on my new page returns results on the first (older) homepage's search.aspx regardless of having put a new aspx file for the result page.

    <form action="limosearch.aspx" method="post" class="searchForm">
    <input type="text" name="search" class="searchInput" value="Søg efter indhold..." onfocus="if (this.value=='Søg efter indhold...') { this.value='' };" onblur="if (this.value=='') { this.value='Søg efter indhold...' };" /> <input type="submit" value="Ok!" class="searchSubmit" />
    <div class="clear"></div>
    </form>

    The above is from the new site where i changed the resultpage from search.aspx to limosearch.aspx.


    I can't figure out why limosearch.aspx returns the first layout when the master reference is for the new layout o_O ?

  • MartinB 411 posts 512 karma points
    Nov 13, 2010 @ 22:08
    MartinB
    0

    Oh i see i made a mistake in the above.

    i DO get the mydomain.dk/limosearch.aspx, but it pulls the layout from the old homepage, and i can't figure out why :/

  • MartinB 411 posts 512 karma points
    Nov 13, 2010 @ 22:16
    MartinB
    0

    Hmm. 7 second rule applies here, almost.

    Deleted the copied search.aspx that i had renamed. Made it again and selected the proper template for it again. Now it works.

    Now i just have to figure out how not to include search results from the old page.

    Any thoughts ?

  • MartinB 411 posts 512 karma points
    Nov 13, 2010 @ 22:49
    MartinB
    0

    Oh well.

    renamed bodyText to bodyTextTwo on the new site and then had to remake all my subpages again for some peculiar reason, and now it works . Dunno if that's the correct way to go about it though.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Nov 17, 2010 @ 12:21
    Douglas Robar
    1

    Changing the name of document type properties to include or exclude them from the search results is an option. :)

    Perhaps the best solution would be set the source="" parameter on the XSLTsearch template. Here's how...

    Select the new site's homepage and look at the Properties tab. You'll see a field for the ID. Copy that number. Then open the template associated with the new limosearch page. You'll see an <umbraco:Macro ...> tag. Paste the id of the new site's homepage into the source="" parameter and save the template. Now XSLTsearch will only look for results in the new homepage and in all the pages below it.

    Or, to achieve the same result but maybe with a bit less work... Open the template associated with the limosearch page. Delete the XSLTsearch macro that is there (making note of any custom settings you've made), and insert the XSLTsearch macro afresh using the 'insert macro' button on the toolbar. You'll be prompted to select the top page and other parameters.

    cheers,
    doug.

  • sun 403 posts 395 karma points
    Nov 19, 2010 @ 07:02
    sun
    0

    Hi, Douglas Robar,if no node id input, you should give two options:

    1. set default start node as $currentPage/ancestor-or-self:*[@level=1] 

    2. set default start node as $currentPage

     

    please update it.

    thanks for your work

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Nov 19, 2010 @ 20:53
    Douglas Robar
    0

    @sun - if no node is selected for the source= parameter how would one distinguish between the two options you suggested? Being fully open-source, you can easily modify XSLTsearch to your own needs as well.

    You might find these two recent blog posts helpful:

    http://blog.percipientstudios.com/2010/11/17/quick-and-easy-multi-lingual-search-pages-for-umbraco-sites.aspx

    http://blog.percipientstudios.com/2010/11/11/user-modification-to-xsltsearch-for-easier-multi-site-searching.aspx

     

    cheers,
    doug.

  • sun 403 posts 395 karma points
    Nov 20, 2010 @ 02:53
    sun
    0

    give a parameter as flag, you can do it.

    startFromCurrentPage=true,

    or 

    startFromRoot=true

Please Sign in or register to post replies

Write your reply to:

Draft