The only other thing you might want to consider is if you want XSLTsearch to always search within absolutely every page of your site, even when using multi-lingual sites or to only search within the site which has the search page in it (this is the default and the approach used in the blog post above).
Am using the ultimate site structure for my multilingual website.
- Content -- My Website Config --- EN --- FR --- DE --- RU
Under each of the langs website all hostnames have already been set up, and all 4 have their own search.aspx page.
What i would like is to be able to search only within the (EN) content if am using the English version of the website. This works well if i only insert my macro in my template and hardcode the id of EN, but then i wont get the expected results when am on the other versions.
source="1462" / /EN
Now if i search through the entire website and am on DE i might be getting the result from a phrase which is on FR and on clicking am no more on the DE Website!
Thanks for the clarity on the site structure... that will be a problem with the way XSLTsearch determines which part of the content tree to search within. By default it looks for all pages that share the same node at level=1. Normally this is the root of each site but you've added an intermediate level with the 'My Website Config' node. So we'll need to modify XSLTsearch to stop at level=2, which is easily done in the xsltsearch.xslt file:
Change this:
<xsl:call-template name="search">
<!-- searches absolutely all pages (useful if you want to search multiple sites at once, or if you do not have all your content pages below a common homepage node in the content tree)
<xsl:with-param name="items" select="umbraco.library:GetXmlAll()/*"/>
-->
<!-- searches all pages within a specific site (useful if you have multiple sites in one umbraco installation) -->
<xsl:with-param name="items" select="$currentPage/ancestor-or-self::* [@level = '1']"/>
</xsl:call-template>
to this to support your site structure (see the bold item for @level = '2' ):
<xsl:call-template name="search">
<!-- searches absolutely all pages (useful if you want to search multiple sites at once, or if you do not have all your content pages below a common homepage node in the content tree)
<xsl:with-param name="items" select="umbraco.library:GetXmlAll()/*"/>
-->
<!-- searches all pages within a specific site (useful if you have multiple sites in one umbraco installation) -->
<xsl:with-param name="items" select="$currentPage/ancestor-or-self::* [@level = '2']"/>
</xsl:call-template>
Doug sometthing out of subject but interesting to talk over it. I have try to add an html tag in my input type search such as <a> and as you would expect got an ugly error page.
Is there a way of encrypting the input text or may be making a javascript validation with regex ??
Changing Location in xslt source for Multinlingual Website
Hi Guys,
I have a multilingual website and using xslt search. What am trying to do here is to change the source for each of the langs present.
Getting the same result under all different search though.
my xslt
template search
//fuji
When source is changed manually in template it gives the right output that is
Any guess what am doing wrong here?
Ttied something like
Seems like source is not changing at all in the search.
When i tried this
and tries to output
Hi, Fuji,
Looks like you're trying to change the 'source' variable based on a dictionary key. That's a unique approach and shouldn't be needed at all.
http://blog.percipientstudios.com/2010/11/17/quick-and-easy-multi-lingual-search-pages-for-umbraco-sites.aspx explains how to set up your multi-lingual sites to search each language site conveniently with XSLTsearch. Really simple.
The only other thing you might want to consider is if you want XSLTsearch to always search within absolutely every page of your site, even when using multi-lingual sites or to only search within the site which has the search page in it (this is the default and the approach used in the blog post above).
cheers,
doug.
Hi Doug,
Am using the ultimate site structure for my multilingual website.
- Content
-- My Website Config
--- EN
--- FR
--- DE
--- RU
Under each of the langs website all hostnames have already been set up, and all 4 have their own search.aspx page.
What i would like is to be able to search only within the (EN) content if am using the English version of the website. This works well if i only insert my macro in my template and hardcode the id of EN, but then i wont get the expected results when am on the other versions.
Now if i search through the entire website and am on DE i might be getting the result from a phrase which is on FR and on clicking am no more on the DE Website!
Thanks for the clarity on the site structure... that will be a problem with the way XSLTsearch determines which part of the content tree to search within. By default it looks for all pages that share the same node at level=1. Normally this is the root of each site but you've added an intermediate level with the 'My Website Config' node. So we'll need to modify XSLTsearch to stop at level=2, which is easily done in the xsltsearch.xslt file:
Change this:
to this to support your site structure (see the bold item for @level = '2' ):
cheers,
doug.
Thanks Doug,
Finally got it working, I thought i could make use of the Dictionary Item for the source as well!...
//fuji
Doug sometthing out of subject but interesting to talk over it. I have try to add an html tag in my input type search such as <a> and as you would expect got an ugly error page.
Is there a way of encrypting the input text or may be making a javascript validation with regex ??
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.