Staticpage sidebar plugin help please

Creating and modifying plugins.
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

OK, so now that's working, thanks Garvin, but I have another question. Sorry about all the questions. In index.tpl how do I query which language the reader has selected using ?serendipity[lang_display]=hu

At the moment I've got {if $lang==hu} which only seems to work when the browser has 'hu' configured as one of the browser display languages, yet in the my other browsers that only have english configured it doesn't work. It makes me thing I'm querying the wrong variable in index.tpl

Have you come across this before?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I believe that variable is not carried through to the templates. Create your config.inc.php with this:

Code: Select all

$serendipity['smarty']->assign('last_lang', $_SESSION['last_lang']);
Thisshould create a $last_langvariable in your templates...

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/
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

Thanks Garvin that seems to have worked perfectly. I'll make sure I update my tutorial so other users can learn from this.
Post Reply