Skip to content

Tag: Joomfish

Joomfish language code tricks

Of course Joom!Fish has no competitors in providing multilanguage solutions for Joomla! But what we always wanted to achieve is to give more and more power to the administrators. And these people care about design, images, language dependents modules and such stuff.

We had some nice tricks with Joom!Fish 1.8.x, but I will provide you now some nice advanced features in respect to the design posibilities with Joom!Fish in terms of different visualisation of your web site in different languages.

As usual, there is no other alternative in the Joomla! multilanguage world to what we offer. Check out our design tricks coming with Joomla! 1.5 and Joom!Fish 2.0.

Note: these tricks require intermediate knowledge in Joomla! and might not be easy to implement for a new users.

 

Load different CSS file, based on the language.

Place this instead of the default load of a CSS file:

<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/<?php echo $this->language ?>.css" type="text/css" />

Now name your CSS files like en-GB.css or bg-BG.css or de-DE.css or whatever language you use.

 

Want to display certain module position only into one language?

Add this to the correct place in you template:

<?php
 if ($this->language=="de-de") {
 ?>
 <jdoc:include type="modules" name="germanmoduleposition" />
<?php } ?>

Now you should place the modules that you want to appear only into the template position named germanmoduleposition.

 

Load different image with the different languages.

Lets imagine you have an image named logo.gif that is the logo of your site. But you want to use different logo for each language.<br /><br />On default the logo will be called with the following command in your template (if it is not called via the CSS):

<img src="/<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/logo.gif" width="260" height="180" alt="Logo" />

Or at least it should be something similar.
Now in order your logo to change with the languages, you need to do replace the following code with:

<img src="/<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/images/<?php echo $this->language ?>.gif" width="260" height="180" alt="_?php echo JText::_('Logo'); ?>" />

What else you have to do is to name your logo images for the different languages en-GB.gif, bg-BG.gif etc.
You also need to add the language definition of the alt text. Lets imagine your template is named nice_template. If it is 1.5 compatible should have a language file under language/en-GB/en-GB.tpl_nice_template.ini

Add at the bottom of this file:
LOGO=Logo

Add the same line for the translation file of each language you use (i.e.
language/de-DE/de-DE.tpl_nice_template.ini : LOGO=Logo German)

For more info: http://www.joomfish.net/en/documentation/joomfish-20/25-tips/90-language-dependent-design-of-course-with-joomfish-only