Bo's blog

Sunday, August 15, 2010

Joomla module depend on the language

Let's assume we offer our content in 2 languages, English and French. We open up our template's index.php file and locate where this change should occur, e.g. in the place of a current module position:

Code:

<?php mosLoadModules ('banner_en',-1); ?>

We change this to the following:

Code:

<?php
if ($mosConfig_lang == 'english' ) {
mosLoadModules ('banner_en',-1);
} else if {
if ($mosConfig_lang == 'french' ) {
mosLoadModules ('banner_fr',-1);
} else { // default - if no language is defined for some reason
mosLoadModules ('banner_en',-1);
}
?>

0 Comments:

Post a Comment

<< Home