andy4oo wrote:Hey guys i using babel multi language site, is there a way to show the results by language? I meant to show them for each language so the guy from english cant see the spanish or oter lang pages. Thanks
I did it this way:
I have different news categories for each language and named them de_DE and en_US and so on...
In Babel's language menu I assign the current language to a variable $currentlang:(later used in news template)
Code: Select all
{if $language->is_current}{assign var=currentlang value=$language->name}
I have a news detailtemplate called searchresult in which I compare $currentlang to news-category:
Code: Select all
{if $currentlang eq 'en' && $entry->category eq "en_US"}
...result...
{elseif $currentlang eq 'de' && $entry->category eq "de_DE"}
...result...
This way I filter out the language results not applicable to the current language.
Finally in the SEARCH resulttemplate:
Code: Select all
{cms_module module='News' action='detail' articleid=$entry->modulerecord detailtemplate='searchresult'}
Works fine!