Joomla 1.5: How To Select Template Based On Language Switch?

This forum includes all questions and reports related the Joom!Fish core extension. This includes all related and with the main package distributed extensions such as the JFRounter, Admin Translation Module, Search Plugins or the Language Selection Module.

We do not support version 1.7/1.8 anymore. You are strongly advised to upgrade your site to the latest Joomla and JoomFish extension
Forum rules
Please visit the Documentation section first. Especially take a look at the Installation issues and the FAQ document.

Before posting, don't forget to search the forums.

If you still have issues, start a topic and include as much information as possible:

First of all, check if you are running the latest available version of Joomla! (1.5.20) and Joom!Fish (2.0.4). Posts for issues, where both systems are not updated, will be ignored.

We need the following at least (you can find this in your Joomla! backend under help > system info):

* PHP version (e.g. 5.2.5). Note: The support for PHP4 is discontinued.
* Joomla! version
* Joom!Fish version
* Web Server software (Apache or IIS with version number if possible)
* Server Operating system (e.g. Linux, Windows, Solaris, Darwin ...)
* Webserver to PHP interface (e.g. apache2handler, cgi-fcgi)
* Database version
* memory_limit from your phpinfo

Please enable error reporting and include any error messages in your posting.

Finally, please describe the steps required to recreate the problem and also please enable error reporting and give us any error messages generated.

Joomla 1.5: How To Select Template Based On Language Switch?

Postby stelios on Thu Apr 02, 2009 11:38 pm

Hi,

Here is the problem that I and many other Joomla 1.5.x users probably face:

I have assigned a different template (as the default) to a few menu-links, and I want to use Joomfish to change this template by another, when choosing a different language in the front-end of this template. As I can understand it, this can only be achieved by altering the index.php file of the above template (since using e.g. the free plug-in Yos this will assign a template for each language for the whole site and not only for the above mentioned e.g. menu links and the specified template).

The facts are:

1). In Joomla 1.0.x the solution is obvious, adding the following lines in the index.php (so that every template would be named by its standard name and a "-en" or "-de" etc. etc.):

Code: Select all
// gets template for page
$cur_template = $mainframe->getTemplate();
// add this
if( $mosConfig_multilingual_support ) {
$cur_template .= "-". $iso_client_lang;
}
else {
$cur_template .= "-en";
}


2). But If you are using Joomla 1.5.x and want to switch templates this method will not work as the variable $mosConfig_lang is not valid to joomla 1.5.x.

In the free plug-in for Joomla 1.5.x, that assigns to every language selected in Joomfish a different template to and for the whole website, the php code looks like these:

Code: Select all
<?php
jimport( 'joomla.plugin.plugin' );
class plgSystemEXAMPLE_jf_template extends JPlugin
{
function plgSystemEXAMPLE_jf_template(& $subject, $config)
{
parent::__construct($subject, $config);
}
function onAfterRoute(){
global $option, $mainframe;
if ($mainframe->isAdmin()) {
return; // Dont run in admin
}
$registry =& JFactory::getConfig();
$jfLang = $registry->getValue("joomfish.language", false);
if (!$lang) {
return;
}
$str_config = $this->params->get('template_config', '');
$str_config = preg_replace('/\s/', '', $str_config);
if (preg_match('/'. $lang->shortcode . '=>(((.*?),)|((.*?)$))/', $str_config, $match)) {
$newTemplate = $match[1];
$newTemplate = preg_replace('/,/', '', $newTemplate);
$mainframe->set('setTemplate', $newTemplate);
}
}
}


You can then in the back-end select and assign the templates for each language like this e.g. en=>ja_purity
(i.e. <params><param name="template_config" type="" size="" default="" label=""
description="shortcode=>template_code, separate by ','. EXAMPLE: en=>beez,de=>rhuk_milkyway,fr=>ja_purity" /></params>)

I would like to try to change and modify the above code in a way that it could be added directly into the index.php of a joomla template, but I am a novice at such things like Joomla plug-ins...

Can someone with the appropriate skills help and propose a solution on how to modify this code and add it in the index.php, so that we would be able to assign to and for a specified template different other templates for each language selected with Joomfish...

Or, in other words, is there a solution in Joomla 1.5.x on how to select a templated based on the language front-end switch adding lines in our index.php? In this way someone could "assign to each template a different template for each language selected" with Joom!Fish. Because with the free Yos plugin you can "assign to each language only one template" and for the whole site. To explain it simple, using the above code as plugin you can "assign to each language" (only) one template, but if you add this code in the index.php of each template then you are in the position to "assign to each template" (and not only to each language & the whole site) a different template for each language, that you select with Joom!Fish.

Can someone propose us which lines to add in the index.phpto achieve this? I opened also a thread about this in the Joomla Forum Language under: http://forum.joomla.org/viewtopic.php?f=485&t=387806


The questions to summarize it all that still remains for many Joomla 1.5.x and Joom!Fish users are: which exactly lines to add in the index.php to assign a template for each language selected in the front-end??? and if this is possible to be implemented in Joomla 1.5.x like it was in Joomla 1.0.x?

Thanks in advance for any further help,
I'm not even sure if I posted in the right Forum in Joom!Fish my question?

Regards, Styl
stelios
Newbee
 
Posts: 5
Joined: Thu Apr 02, 2009 11:20 pm

Re: Joomla 1.5: How To Select Template Based On Language Switch?

Postby stelios on Fri Apr 03, 2009 9:43 pm

Hi,

I tried to make also a workaround to the above problem with a cookie that I use, but Joomla 1.5.9 has still some bugs and does not work as it should have!

I established e.g. in a menu (e.g. in example pages) a menu link pointing to the external link: a page in my joomla (like http://www.yoursite.com/index.php option=com_content&view=article&id=19&Itemid=27&lang=de) and did then assign from the back-end to this menu link a different template (e.g. beez). When I call this link then the default template does not change to the assigned templated (here beez)!?!? Therefore some more improvements to Joomla 1.5.9 should be made, since it still does not work always properly, fixing some bugs!

A template selected in the back end for a menu link (pointing to an external link) does not change the default template when you call this link, the link works alright but still with the default template?!?!?!

Anyone can test that Joomla 1.5.9 does not work properly (and in this direction it must be upgrated to solve among others also this problem): Just go to the Menu Item Manager, choose menu Example Pages, then New and then External Link, give there any title you want e.g. EXPERIMENT and as link give e.g. the link to the page in the main menu e.g. Joomla! Overview (from the integrated sample data)(URLofYourSite/joomla159/index.php?option=com_content&view=article&id=19&Itemid=27&lang=en), choose Save, go now to the Template Manager, choose now a different template as the default that you have, e.g. beez and click Edit, then choose Select from List (Menu Assignment) and in the Menu Selection choose the created menu link from the menu ExamplePages EXPERIMENT (hold down the Ctrl key and choose also another link e.g. Section Blog for testing!), click save and then Preview; in your home site you can now choose from the menu Example Pages the link that you have created EXPERIMENT, as you can see the template does not change to beez as you do so!?!?!?, on the contrary if you choose the link Section Blog the template does change to beez...

Has somebody any idea on how to fix this bug in Joomla 1.5.x ( I use 1.5.9)?

If Joomla where an European project, then something like Joom!Fish would have been integrated in the core functions of Joomla from the beginning, but still as the saying goes "one nation, one planet", the Joomla team should therefore consider and do that anyway in the future upgrades of Joomla.

Thanks for any help in advance

Styl
stelios
Newbee
 
Posts: 5
Joined: Thu Apr 02, 2009 11:20 pm

Re: Joomla 1.5: How To Select Template Based On Language Switch?

Postby stelios on Mon Apr 06, 2009 10:34 pm

Hi again,

Here is some kind of a solution to the above problem, so that someone can do stuffs according to the current language selected. In this way someone could be able to differentiate our template in respect to the each language every time in use - but still the big problem remains: how to assign to each template a different one, for each language selected, adding the appropriate code in the index.php, I hope that somebody will at the end help and solve this problem???

What someone needs to do now in his template is determine if he is on the language in use specific page and make the necessary changes to the template based on which type of page he is on...

here is some code that can help with this:

Code: Select all
$config = &JFactory::getConfig();
$lang = $config->getValue('language');
// Predifine this early in the head section
if ($lang == 'de-DE') {
  //do the german language stuff
} else {
  // do the other languages page stuff
}


We can use so the "if blocks" where the code between a selected language page and the rest languages page shall be different. For example, lets say that our German language page template and our other language page is the same except that the German language page doesn't have a left column, plus the English language page has a 'picture' position that has a image which comes somewhere under the header. In this case the exact code will be as follows:

in the head section of the template add:

Code: Select all
<?php
      $config = &JFactory::getConfig();
      $lang = $config->getValue('language');
?>


and in the body section add this lines where the code should differ:

Code: Select all
<?php
   if ($lang != 'de-DE') :  // If the current language is not german include the right column ?>
   <div id="rightcolumn">
   <jdoc:include type="modules" name="right" style="xhtml" />
   </div>
   <?php endif; ?>
   ...   
   <?php
   if ($lang == 'de-DE') : Include in the german language page the 'picture' image module ?>
   <div id="picture">
   <jdoc:include type="modules" name="picture" style="xhtml" />
   </div>
    <?php endif; ?>
    ...


This brief step by step tutorial would have been incomplete without some sample page included? For example, the code of the template that follows has inside some "if blocks" to do separate stuff according to the language in use (or if we are in our home or interior pages, or in a particular component type page etc).

Code: Select all
<?php
/**
* Example template code (with two user collapsable positions etc. implementing if blocks for language selected
* or component in use, or if we are in the home or interior pages ect.
* .........................
*/

// no direct access
defined('_JEXEC') or die('Restricted access');
?>
<?php echo '<?xml version="1.0" encoding="utf-8"?' .'>'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this-

>language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo

$this->direction; ?>" >

<head>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>"

/>
<?php
   $pageoption = JRequest::getVar('option', '');
   $pageview = JRequest::getVar('view', '');
   $config = &JFactory::getConfig();
   $lang = $config->getValue('language');
?>

   <jdoc:include type="head" />

   <link href="/templates/<?php echo $this->template; ?

>/css/template_css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
  <div id="header">
     <div id="banner">
     <a href="/"><img src="/templates/<?php echo $this->template; ?

>/images/logos/logo.png" alt="Home" border="0" align="left" id="logo"

/></a>
    <jdoc:include type="modules" name="banner" style="xhtml" />
    <jdoc:include type="modules" name="header" style="xhtml" />
     </div>
     <?php if ($this->countModules('top')) : ?>
            <div id="top-module">
               <jdoc:include type="modules" name="top" style="xhtml" />
            </div><!-- end top-module -->
            <?php endif; ?>
     </div> <!-- End header -->
<div id="topnav">
   <jdoc:include type="modules" name="topnav" style="xhtml" />
  </div> <!-- End topnav -->
<!-- HERE IS FOR EXAMPLE THE IF BLOCK to include the 'picture' position that has an image which comes right under the header only if the selected language is English -->
<?php if($lang == 'en-GB'): ?> :  // If the selected language is English, so include the 'picture' image module ?>
    <div id="picture">
   <jdoc:include type="modules" name="feature" style="xhtml" />
    </div>
  <?php endif; ?>
      <div id="main">
        <div id="content">
<!-- HERE IS FOR EXAMPLE THE IF BLOCK don't show the breadcrumbs on the extension community builder type pages -->
     <?php if ($pageoption != 'com_comprofiler') : // Don't show the breadcrumbs on the community builder particular component type pages ?>
      <div id="breadcrumbs">
        <jdoc:include type="modules" name="breadcrumbs" />
      </div><!-- end breadcrumbs -->
     <?php endif; ?>
          <div id="mainbodby">
     
            <div id="top-user-modules">
            <?php if ($this->countModules('user1')) : ?>
            <div id="user1">
            <jdoc:include type="modules" name="user1" style="xhtml" />
            </div><!-- end user1 -->
            <?php endif; ?>
            <?php if ($this->countModules('user2')) : ?>           

            <div id="user2">
            <jdoc:include type="modules" name="user2" style="xhtml" />   
            </div><!-- end user2 -->
            <?php endif; ?>         
             </div><!-- end top-user-modules -->
           
          <jdoc:include type="component" />
          </div><!-- end mainbody -->


<!-- HERE IS FOR EXAMPLE THE IF BLOCK to show the left column only if the language in use is the e.g. the German language -->
      <?php if($lang == 'de-DE'): ?>
       <div id="leftcolumn">
     <jdoc:include type="modules" name="left" style="xhtml" />
         </div> <!-- End leftcolumn -->
    <?php endif; ?>

<!-- HERE IS THE FOR EXAMPLE IF BLOCK to show the right column only on the home page -->
     <?php if ($pageview == 'frontpage') : ?>
           <div id="rightcolumn">
      <jdoc:include type="modules" name="right" style="xhtml" />
           </div> <!-- End rightcolumn -->
   <?php endif; ?>
         
      </div>
    </div><!-- end BodyContent -->
<div id="footer" class="clearfix">
           <?php if ($this->countModules('footer')) : ?>
         <div class="inside">
               <jdoc:include type="modules" name="footer" style="xhtml" />
            </div><!-- end inside -->
            <?php endif; ?>
        </div><!-- end footer -->
       </div><!-- end page -->
    <?php if ($this->countModules('debug')) : ?>
    <div id="debug"><jdoc:include type="modules" name="debug" /></div>
    <?php endif; ?>
</body>
</html>


The template code above should give us an idea, on how to go about in changing the template for each language in use (or the home or interior pages or particular component type pages).

I hope that someone will help and figure the needed code out, on how to assign to a specific template a different one for each language selected with Joom!Fish.

Regards,

Styl
stelios
Newbee
 
Posts: 5
Joined: Thu Apr 02, 2009 11:20 pm

Re: Joomla 1.5: How To Select Template Based On Language Switch?

Postby stelios on Thu Apr 16, 2009 11:09 pm

Hi,

I figured finally out also how to assign for each language selected a different template... So,
if you want to create a site with a totally different template for each language selected, then you
need to call the templates by using PHP and if conditions in a "fake template". The logic here
is that you must have already defined a default template in your database; in the index.php file
of this default template you must also set the right conditions like this:


If the language selected is English include once the file english-template/index.php

\/ (If the answer is NO then continue
\/ with the else statement)
\/
If the language selected is German include once the file german-template/index.php

\/ (If the answer is NO then continue
\/ with the else statement)
\/
If the language selected is French include once the file french- template/index.php

\/
\/
\/
.................


In other words, the fake template will have only this (index.php code) inside:

Code: Select all
<?php
  $config=&JFactory::getConfig();
  $lang=$config->getValue('language');
if ($lang=="en-GB")
include_once("english-template/index.php");
else
if ($lang=="de-DE")
include_once("german-template/index.php");
else
if ($lang=="fr-FR")
include_once("french-template/index.php");
....
?>


As example, if we use for the english language the beez template, for the german language the
rhuk_milkyway template, and for the french language the ja_purity template, then your fake
template will just say this:

Code: Select all
<?php
  $config=&JFactory::getConfig();
  $lang=$config->getValue('language');
if ($lang=="en-GB")
include_once("beez/index.php");
else
if ($lang=="de-DE")
include_once("rhuk_milkyway/index.php");
else
if ($lang=="fr-FR")
include_once("ja_purity/index.php");
?>


In this example, to be more analytical, I have created in the htdocs/template a template file (e.g.
with the name fake-template) and copied in this template file the whole template files of the above three templates.
So when you choose as default template the fake-template, then your default template will be
beez, and when you choose then the german language, the template will change to rhuk_milkyway and when you select french the template turns to ja_purity. Of course, in this
example, in the two of this templates you can select parameters in the back end, therefore we
have to change the index.php code of this templates accordingly, since the parameters can only
be called if the specific template is active as a default one in joomla (but obviously our default
template remains always the fake-template). Furthermore you must correct also the path for the
css etc. files (except if you have this templates also as separate ones in your templates file, then
the css ect. files can be loaded directly from there). For the rhuk_milkyway the code correction is
the following:

This code in the index.php:

Code: Select all
...
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css"
type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css"
type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/rhuk_milkyway/css/template.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/rhuk_milkyway/css/<?php
echo $this->params->get('colorVariation'); ?>.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/rhuk_milkyway/css/<?php
echo $this->params->get('backgroundVariation'); ?>_bg.css" type="text/css" />
<!--[if lte IE 6]>
<link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/ieonly.css" rel="stylesheet" type="text/css" />
<![endif]-->
<?php if($this->direction == 'rtl') : ?>
   <link href="<?php echo $this->baseurl ?>/templates/rhuk_milkyway/css/template_rtl.css" rel="stylesheet" type="text/css" />
<?php endif; ?>
</head>
<body id="page_bg" class="color_<?php echo $this->params->get('colorVariation'); ?> bg_<?php
echo $this->params->get('backgroundVariation'); ?> width_<?php echo $this->params->get
('widthStyle'); ?>">
...


must be changed to this code (if you want to choose the white variation and the template width
medium (i.e. 950px):

Code: Select all
...
<head>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css"
type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css"
type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/fake-template/rhuk_milkyway/css/template.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/fake-template/rhuk_milkyway/css/blue.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/fake-template/rhuk_milkyway/css/blue_bg.css" type="text/css" />
<!--[if lte IE 6]>
<link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/fake-template/css/ieonly.css" rel="stylesheet" type="text/css" />
<![endif]-->
<?php if($this->direction == 'rtl') : ?>
   <link href="<?php echo $this->baseurl ?>/templates/fake-template/rhuk_milkyway/css/template_rtl.css" rel="stylesheet" type="text/css" />
<?php endif; ?>
</head>
<body id="page_bg" class="medium_small">
...


I hope that the above codes will give an idea on how to go about in changing the templates for
the language each time in use...

Regards, Styl


PS: To my earlier post about the "if blocks" I have to add that it is obvious that someone can use
"and" & "or" statements to do more complicated stuff, even integrate a whole template... For
example, you can write the if blocks like this:

1)
Code: Select all
<?php if($lang == 'de-DE or da-DK or fr-FR or ru-RU'): // You can do stuff which will appear only in this four languages: German, Danish, French and Russian ?>


or like this

2)
Code: Select all
<?php if($lang == 'de-De' and $pageview != 'frontpage' and $pageoption == 'com_comprofiler'):
?>: // You can do stuff which
will appear only in the German language selection and only in the interios pages, and if it is
community builder particular component type page ?>


or

3) if you want to have a collapsible e.g. left column which should show only if the selected
language is English, then for example in the template ja_purity the code should be modified to:

Code: Select all
<?php if ($this->countModules('right') and $lang == 'en-GB'): ?>
      <!-- BEGIN: RIGHT COLUMN -->
      <div id="ja-col2">
         <jdoc:include type="modules" name="right" style="jarounded" />
      </div><br />
      <!-- END: RIGHT COLUMN -->
      <?php endif; ?>


4) you can even integrate a whole template in the if blocks (if you don't want to use a fake
template), like this for the english, german and other languages:

Code: Select all
...
<head>
...
<?php
if ($this->language=="en-GB"): ?>
<link rel="stylesheet" href="/<?php echo $this->baseurl ?>/<?php echo $this->template ?>/css/template_en.css" type="text/css" />
<?php else
if ($this->language=="de-DE"): ?>
<link rel="stylesheet" href="/<?php echo $this->baseurl ?>/<?php echo $this->template ?>/css/template_de.css" type="text/css" />
<?php else
if ($this->language=="..-.."): ?>
<link rel="stylesheet" href="/<?php echo $this->baseurl ?>/<?php echo $this->template ?>/css/template_OTHERlanguage.css" type="text/css" />
<?php } endif; ?>
...
</head>
<body>
...
<?php if ($lang == 'en-GB': //You can put the php body code of your template for the english
language which has the template_en.css stylesheet
?>
<?php if ($lang == 'de-DE': //You can put the php body code of your template for the german
language which has the template_de.css stylesheet
?>
<?php if ($lang == '..-..': //You can put the php body code of your template for the .. language
which has the template_OTHERlanguage.css stylesheet
?>
...
</body>
...
stelios
Newbee
 
Posts: 5
Joined: Thu Apr 02, 2009 11:20 pm

Re: Joomla 1.5: How To Select Template Based On Language Switch?

Postby stelios on Fri May 01, 2009 1:29 am

Hi,

In my earlier post I have mistyped and the following corrections should be made, the correction for the rhuk_milkyway code is obviously for the blue (background/color) variation (if you want the white variation you have to change the files from blue.css and blue_bg.css to white.css and white_bg.css, or if you want blue background and white color then change to white.css and blue_bg.css), also for template width you have to correct the code to <body id="page_bg" class="width_medium"> or if you want the "fluid with maximum" one (min-width 750px and max-width 1050px) then change the class to "width_fmax", also correct the path in the IE 6 hack... etc.
In my earlier post in PS: 4) it is obvious also that you should put all your template body code in <?php if ($lang == 'en-GB': // Put here all the body code of your template for the english language ?>...<?php endif; ?> etc., and obviously the head section should be written with the correct placing of "{", etc., so the head/body sections to function properly must be corrected to:

Code: Select all
...
<head>
<?php
$config=&JFactory::getConfig();
$lang=$config->getValue('language');
if($lang == 'en-GB') { ?>
<link rel="stylesheet" href="/<?php echo $this->baseurl ?>/<?php echo $this->template ?>/css/template_en.css" type="text/css" />
<?php } else 
if($lang == 'de-DE') { ?>
<link rel="stylesheet" href="/<?php echo $this->baseurl ?>/<?php echo $this->template ?>/css/template_de.css" type="text/css" />
<?php } else 
if($lang == '..-..') { ?>
<link rel="stylesheet" href="/<?php echo $this->baseurl ?>/<?php echo $this->template ?>/css/template_OTHERlanguage.css" type="text/css" />
<?php } ?>
</head>

<body>
<?php if ($lang == 'en-GB': //You can put in this if block the php body code of your template for the english language which has the template_en.css stylesheet ?>
...
<?php endif; ?>
<?php if ($lang == 'de-DE': //You can put in this if block the php body code of your template for the german language which has the template_de.css stylesheet ?>
...
<?php endif; ?>
<?php if ($lang == 'fr-FR': //You can put the php body code of your template for the .. (OTHER) language which has the template_OTHERlanguage.css stylesheet ?>
...
<?php endif; ?>
</body>


or, if you prefere, you can write the head section simply with separated if blocks like this:

Code: Select all
<head>
<?php if($lang == 'en-GB'): ?>
<link rel="stylesheet" href="/<?php echo $this->baseurl ?>/<?php echo $this->template ?>/css/template_en.css" type="text/css" />
<?php endif; ?>
<?php if($lang == 'de-DE'): ?>
<link rel="stylesheet" href="/<?php echo $this->baseurl ?>/<?php echo $this->template ?>/css/template_de.css" type="text/css" />
<?php endif; ?>
<?php if($lang == '..-..'): ?>
<link rel="stylesheet" href="/<?php echo $this->baseurl ?>/<?php echo $this->template ?>/css/template_OTHERlanguage.css" type="text/css" />
<?php endif; ?>
</head>


I hope this corrections will also help

Regards,
Styl


PS: It is obvious that you have to create more than one fake template if you want to assign different (as the default) templates to menus and/or links, sections or categories etc..., and in such a case you can assign to your second (or third or whatsoever) fake template whatever other templates you wish for each language selected with Joom!Fish... (something impossible if should use the above mentioned plugin...).
stelios
Newbee
 
Posts: 5
Joined: Thu Apr 02, 2009 11:20 pm

Re: Joomla 1.5: How To Select Template Based On Language Switch?

Postby ste on Sat May 09, 2009 6:10 pm

Hi stelios,
thanks for your complete and useful tutorial!
I will try to implement it in my site, probably I will use the first solutions with one template.
ste
Newbee
 
Posts: 3
Joined: Thu Apr 17, 2008 2:53 pm

Re: Joomla 1.5: How To Select Template Based On Language Switch?

Postby buzzki on Tue Jan 12, 2010 7:06 am

Hi all,

yesterday I released an extension for Joomla that can do exactly what you are asking for. Without fake templates, without hacking Joomla files, and using a nice centralised interface.

It's called MetaTemplate, and it allows you to change template based on almost any criteria you can think of - including, in your case, front-end language.

See http://www.metamodpro.com/software/metatemplate for more details.

MetaTemplate comes in 2 versions - the lite (free) version and MetaTemplate Pro ($19), that comes with super-easy configuration of the "rules". Rules include changing the template based on front-end language, browser language, user id, user groups, article id, sections, categories, browsers, domain names (e.g. use a different template for de.domain.com and fr.domain.com even if they are on the same Joomla installation), and lots more.

Hope this helps,
Stephen Brandon
http://www.metamodpro.com
buzzki
Newbee
 
Posts: 10
Joined: Tue Jun 24, 2008 10:46 pm


Return to Joom!Fish 2.0.x Core Extension

Who is online

Users browsing this forum: No registered users and 3 guests