|
See JOOMFISH 1.7 Tips & tricks in the Joomla! Forums. Taken from that post: TIP 1 - HOW TO LOAD A CSS DEPENDING OF THE LANGUAGE FRONT-END SWITCH ?1. Add the following tag in your template index.php file: <link href="<?php echo $mosConfig_live_site;?>/templates/ YOUR TEMPLATE NAME/css/<?php echo $mosConfig_lang;?>.css" rel="stylesheet" type="text/css"/> This will write CSS files, depending of the selected language: english.css, spanish.css, german.css, italian.css, portuguese.css, etc... 2. If your defaut joomla language is set to english, then leave english.css empty & place it in the /templates/YOUR TEMPLATE NAME/css/ directory. Customize the other css files according to your needs. The most natural use is to change the path to an image file: #whatever { background-image: url("../images/header_german.gif"); for the german.css file } #whatever { background-image: url("../images/header_spanish.gif"); for the spanish.css file } Place the produced CSS files into the /templates/YOUR TEMPLATE NAME/css/ directory How to select a template based on the language front-end switch?The most easy solution is to add the following lines in your index.php // gets template for page $cur_template = $mainframe->getTemplate(); // add this if( $mosConfig_multilingual_support ) { $cur_template .= "-". $iso_client_lang; } else { $cur_template .= "-en"; } Now every template would be named with his standard name plus a "-en" or "-de" or anything else.
|
0 Comments