Page 1 of 1

Different link addresses in navbar, depending on language?

Posted: Fri Sep 01, 2006 2:06 pm
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

Re: Different link addresses in navbar, depending on languag

Posted: Fri Sep 01, 2006 2:09 pm
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