Copied to clipboard

Flag this post as spam?

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


  • Peter Cort Larsen 421 posts 1038 karma points
    Jun 19, 2013 @ 11:51
    Peter Cort Larsen
    0

    Multi lingual website

    Hi,

     

    How do i make the search to only look under the current domain?

    On the danish website, i sometimes have an english text, but i only want results from the danish domain, not from the english domain. Plus i have 2 more domains setup.

    Can this be accomplished?

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jun 19, 2013 @ 12:00
    Douglas Robar
    0

    It can!

    Can you show a sample of how you've set up your content trees for the different domains? That will help a lot in explaining 'how to' and being sure to give the best answer.

    For example, often people have this sort of content tree:

    CONTENT
    - EN
    - - Products
    - - About
    - - Search
    - DK
    - - Danish Products
    - - Danish About
    - - søg
    - FR
    - - French Products
    - - chercher 

     

    Each language has its own section of the site, with its own search page.

    cheers,
    doug. 

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Jun 19, 2013 @ 12:02
    Chriztian Steinmeier
    0

    Hi Peter,

    That should be configurable with one of the parameters you pass to the macro - the source parameter, I believe it is...

    Had a quick look at the XSLT file - it seems like if you set it to the search page's id, it will only search within the "site" that contains the search page.

    /Chriztian

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jun 19, 2013 @ 12:28
    Douglas Robar
    1

    Exactly, Chriztian -- if you have a content tree set up as shown above, you can leave the 'source' parameter EMPTY for the XSLTsearch macro and it will automatically search only within the part of the tree the search page appears within. That way you can use the same template and settings for all search pages and it will 'just work' :)

    Be sure to update the dictionary keys for your various languages, too, to get maximum multi-lingual support. The keys are all set up for you, you just need to translate them to your languages and again, it will just work.

    cheers,
    doug. 

  • Peter Cort Larsen 421 posts 1038 karma points
    Jun 19, 2013 @ 12:51
    Peter Cort Larsen
    0

    Hi,

     

    My tree looks like this:

    CONTENT
    MAIN FOLDER
    ENGLISH
    DANISH
    SPANISH
    GERMAN 

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jun 19, 2013 @ 13:05
    Douglas Robar
    0

    Thanks, that's helpful.

    What's in the 'Main folder'? Do you have one search page for everything, or a search page per language?

    cheers,
    doug. 

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 19, 2013 @ 13:13
    Fuji Kusaka
    100

    Looks like you are using the ultimate site structure right ? 

    If so you will need to change the level in xsltSearch to 2

    <xsl:with-param name="items" select="$currentPage/ancestor-or-self::* [@level = '2']"/>
  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jun 19, 2013 @ 13:18
    Douglas Robar
    0

    Ahhh... thanks, Fuji, that might be it. The way Peter formatted his answer the nesting/indentation isn't obvious but you maybe correct.

    Peter, is your site structured like this (option A):

    CONTENT
    - Main Folder
    - English
    - Danish
    - Spanish
    - German 

    or like this (option B):

    CONTENT
    - Main Folder
    - - English
    - - Danish
    - - Spanish
    - - German

    cheers,
    doug. 

  • Peter Cort Larsen 421 posts 1038 karma points
    Jun 19, 2013 @ 13:25
    Peter Cort Larsen
    0

    Perfect Fuji. It works

     

    Thanks everybody.

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 19, 2013 @ 13:29
    Fuji Kusaka
    0

    No worries, this is what this community is all about. Sharing and helping others.

    Thanks to the Life Time MVP for this package !

Please Sign in or register to post replies

Write your reply to:

Draft