Forum for discussing general topics related to Couch.
8 posts Page 1 of 1

I'm running a bilingual web portal on Couch CMS and I need some help to figure out how to display search results only on the right language (english on En version and german on De version). The way the portal is structured is just how you suggested to me:

---- couch
---- en
---- de

Now the results are displayed from both versions of portal, it's a mixed something :(

Thank you.

As we two had discussed in viewtopic.php?f=2&t=74&p=329, the names of the templates in your setup should be something like -
English : 'en/index.php', 'en/about.php', 'en/news.php'
French: 'fr/index.php', 'fr/apropos.php', 'fr/nouvelle.php'
where the names have the language prefixed.

With the stated setup, to handle the search issue you mentioned I think we can proceed like this -
Implement the 'search' template for both the languages following the same convention. i.e 'en/search.php' and 'fr/search.php'.

The cms:search ( tag within these templates that actually fetches in the matching pages supports the 'masterpage' parameter where you can specify the names of the templates that need to be searched.
We can use this parameter to make the English language search page search only within the templates of English language and likewise the French search template use the French language templates only.

E.g. en/search.php could have something like this
<cms:search masterpage='en/index.php, en/about.php, en/news.php' limit='10'>..</cms:search>

while fr/search.php could have -
<cms:search masterpage='fr/index.php, fr/about.php, fr/news.php' limit='10'>..</cms:search>

Please let me know if this helped.
Thank you, it's working :D . As I can see, following the link you provided, everything was explained in details in the Documentation section, but somehow I missed that part when I had read about implementing search in Couch. Sorry for that, and thank you again for helping me out.

Out of curiosity: If I had created this structure with the nested pages concept and just one index.php like this:


How would I proceed then?
The search part won't be able to differentiate between the languages as in this case the template being used would be the same for both the languages.
Adding to the previous post -
If the nested pages are actually masquerading other templates, then it is the same as the normal case of using separate templates. The 'search' tag can be provided the names of the actual templates being masqueraded it will work.
I see... so in the case of a multilangual website it's better to create a sperate nest for every single language? One out of de/index.php, one of en/index.php etc.? Assuming not every nested page is masquerading/redirecting but some are actual "pages".
Yes, I think that should work fine.
8 posts Page 1 of 1

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests