multilingual-plugin: Showing only Entrys in selected lang

Creating and modifying plugins.
Post Reply
PierreW
Posts: 2
Joined: Mon Aug 13, 2007 3:22 pm

multilingual-plugin: Showing only Entrys in selected lang

Post by PierreW »

Hello,

actually i'm working in trying to get the multilingual-Plugin only showing entrys that are translated in english when english language is selected (so hiding those, that are not translated).
I could just filter in the event-file those entrys that are avaible in english, but that would show on a 10 entrys page with maybe 5 translated only those 5 on the index page..

Any suggestions?

Thanks in advance!
- PierreW
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: multilingual-plugin: Showing only Entrys in selected lan

Post by garvinhicking »

Hi!

Yeah, that's a shortcoming that I don't think is fixable.

Have you tried about setting up categories? You can create categories for english, french etc. and then you can assign those multilingual entries to the specific category, and then you only see entries in the category view for that language...

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
PierreW
Posts: 2
Joined: Mon Aug 13, 2007 3:22 pm

Post by PierreW »

I've found a solution on that problem - i guess it's not intended by the module creator, but it works fine for us.

In the frontend_fetchentry-hook i just modified

Code: Select all

                    if (!empty($this->lang_display)) {
                        // If lang_display is set - we want ONLY the entries which have translation
                        $eventData['and'] .= " AND multilingual_body.value IS NOT NULL";
                    }
with

Code: Select all

                    if ($this->showlang == "en") {
                        // If lang_display is set - we want ONLY the entries which have translation
                        $eventData['and'] .= " AND multilingual_body.value IS NOT NULL";
                    }
Fine enough for us just wanting to make a difference between german and english.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Oh, okay. I didn't know it was that easy. Good job! :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply