Problem: Search module shows results in wrong language

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Marciux

Problem: Search module shows results in wrong language

Post by Marciux »

I have a default 1.0.2 version installed and I am using the default Search module to search my site in two languages - English and Lithuanian.
The results are being displayed in two different pages (alias "search_en" and "search_lt"). The search forms are also configured to send data to these pages.

When I search the English version of site (with {search resultpage="search_en" lang="en_EN"} in content body), I have no problems. But when I try to search Lithuanian version of site ({search resultpage="search_lt" lang="lt_LT"}) I have a problem - search box appears correctly, but the results appear in English language.

The "Default language for the frontend" setting doesn't select any language for me. If I enter Lithuanian there, then all the search results (English ones also) are displays in Lithuanian language.

Result page (search_lt) uses Lithuanian template and I don't want to show an English words there... Any ideas  ???

Hint: may be there is a possibility to pass different "Default language for the frontend" values for different pages or templates? That would help me I think.
User avatar
manuel
Power Poster
Power Poster
Posts: 354
Joined: Fri Nov 30, 2007 9:15 am

Re: Problem: Search module shows results in wrong language

Post by manuel »

I've been experiencing the same problem (but with cmsms 1.6.7 and search 1.6.1
I didn't understand why for one of my websites it was no problem to have the
search results page show in the correct language while for a different one
hosted on the same server, it seemed impossible!
I meticulously compared every piece of code used by the module! Well, not the
script itself but you know what I mean, the code generated as output and the
templates used by the search module, the permissions for the files and folders
on the server, the default front end language, the version number of the search
modules, ......... ;D, I even upgraded both sites to the latest version of cmsms
and reinstalled the search module (even though it was the same version).

Finally I've tried repositioning the search box to a different position in the
template and the problem was instantaneously fixed!!
As i wanted to keep the search box in the old location but the search box in the
new location was critical to make the search results appear in the correct
language, i tried to include both boxes in the template and hide one for the
visitors...

This is the code that worked for me:

Code: Select all

<div style="display:none;">{search lang="fr_FR"}</div>
<div id="contentMain">
<h1>{title}</h1>
{content}
</div>
{search lang="fr_FR"}
If anyone knows what's causing this behavior, i would love to hear from you!
Maybe a less ugly solution is possible?

Greetings,
Manuel
Do you like your open source cms? Buy from the CMSMS partners || Donate
Locked

Return to “CMSMS Core”