Different link addresses in navbar, depending on language?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Harald Weingaertner
Regular
Posts: 474
Joined: Mon Mar 27, 2006 12:32 am

Different link addresses in navbar, depending on language?

Post by Harald Weingaertner »

Hello,

i would like to use a theme like smallbiz or andreas*.* with integrated links configurable in the style-options.

Now i ask myself if it is possible to have different links in those navbars, based on the language a visitor uses?

Lets say, we have the links: ABOUT, GUESTBOOK, DOWNLOADS

about shall point to /about.html for german visitors (for visitors viewing the blog in german) and to /en/about.html for visitors viewing the blog in english. Is this possible somehow? Maybe with an "if {language}=en" statement somewhere in a .tpl file?

Regards, Harald
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Different link addresses in navbar, depending on languag

Post by garvinhicking »

Hi!

That would mean one config option in the template's config for each language. Thus, it's not feasible.

Instead you should edit your index.tpl file manually, insert links manually and assign the $serendipity['lang'] variable via a template's config.inc.php as a smarty variable so that you can check it in your index.tpl. Then you can use the check you mentioned.

config.inc.php:

Code: Select all

$serendipity['smarty']->assign('language', $serendipity['lang']);
HTH,
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