Multilingual footers and other common content
Posted: Sun May 28, 2006 7:18 pm
Please also see my last post in this topic!
Multilingual footers and other common content
when using the multilingual hack by katon (good work btw), I needed a way to select footers based on the language selected. Since this was not included I decided to have a go at this myself. This is what I got to:
1. define a new User Defined Tag (ie multilingual_footer) with the following code:
$l=$_GET['lan'];
switch ($l):
case 'nl':
echo 'Dutch footer goes here';
break;
case 'en':
echo 'English footer goes here';
break;
default:
echo 'Default footer goes here';
endswitch;
2. change the Global Content Block 'footer' to include (can be the only entry in this Block):
{multilingual_footer}
3. also add the following in template_config.php (around line 43) for more xhtml compliant code (add ALT text and close IMG tag):
"en" => '',
"nl" => ''
etc.
And you are done!
The same setup can be used for other common language dependent data also, like Meta Data. One should then not use the default {metadata} tag in the template used, but the newly defined User Tag for this to work. I know, it is not pretty, but it works!
If anyone has some other ideas or suggestions, please do
Multilingual footers and other common content
when using the multilingual hack by katon (good work btw), I needed a way to select footers based on the language selected. Since this was not included I decided to have a go at this myself. This is what I got to:
1. define a new User Defined Tag (ie multilingual_footer) with the following code:
$l=$_GET['lan'];
switch ($l):
case 'nl':
echo 'Dutch footer goes here';
break;
case 'en':
echo 'English footer goes here';
break;
default:
echo 'Default footer goes here';
endswitch;
2. change the Global Content Block 'footer' to include (can be the only entry in this Block):
{multilingual_footer}
3. also add the following in template_config.php (around line 43) for more xhtml compliant code (add ALT text and close IMG tag):
"en" => '',
"nl" => ''
etc.
And you are done!
The same setup can be used for other common language dependent data also, like Meta Data. One should then not use the default {metadata} tag in the template used, but the newly defined User Tag for this to work. I know, it is not pretty, but it works!
If anyone has some other ideas or suggestions, please do
