The Joomla! Forum ™





Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Mon Nov 14, 2005 9:24 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Nov 14, 2005 9:18 pm
Posts: 13
Hello,

I am using the latest version of mambelfish, to let users switch choose between french and english on the frontend. My problem is that I also need this action to switch between french and english graphic templates, because it is a graphic heavy website with lots of french and english text embedded in their respective templates.

Could I maybe assign these templates in the XML files for the English and French language templates. So that the graphics are changed as well as the content.

Thanks very much for any help.


Top
 Profile  
 
PostPosted: Tue Nov 15, 2005 8:47 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 5:23 pm
Posts: 557
Location: Gogledd Cymru
The easiest solution is to create a dummy template index.php file that checks which language is being viewed (you could check the glabal variable $mosConfig_lang) and include the appropriate language dependent index.php template file.

Geraint

_________________
email: opensourcematters at copynDOTplusDOTcom


Top
 Profile  
 
PostPosted: Tue Nov 15, 2005 2:44 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Nov 14, 2005 9:18 pm
Posts: 13
Thanks for the help,

but what would the code look like in the dummy template, to "check".

Eimhin


Top
 Profile  
 
PostPosted: Tue Nov 15, 2005 5:16 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 5:23 pm
Posts: 557
Location: Gogledd Cymru
Try a variation of :

Code:
<?php
 global $mosConfig_lang;
if ($mosConfig_lang=="language1") include_once("language1Template.php");
else if ($mosConfig_lang=="language2") include_once("language2Template.php");
?>


Do some tests with "echo" to get the right string to test against.

Geraint

_________________
email: opensourcematters at copynDOTplusDOTcom


Top
 Profile  
 
PostPosted: Tue Nov 15, 2005 5:58 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Nov 14, 2005 9:18 pm
Posts: 13
So I would put that string in a blank dummy index.php with just that string, or with the rest of the usual header code?

Sorry, I am a beginner, I am not sure how I should sort it out.

So since my two templates (French_template.php and English_template.php) will use the same css and image folder, I will just keep them all in the same template folder and then turn the "index.php" into a dummy index with joomla header code and the string? or just that string?

I'll start experimenting

Thanks


Top
 Profile  
 
PostPosted: Tue Nov 15, 2005 7:21 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 5:23 pm
Posts: 557
Location: Gogledd Cymru
It should work with just that code I suggested since your French_template.php/English_template.php (in the same folder) will take over once they are included.

Have a go, experiment - hope it works out.  Your questions suggest you understand enough to figure it out.

Geraint

_________________
email: opensourcematters at copynDOTplusDOTcom


Top
 Profile  
 
PostPosted: Fri Dec 23, 2005 3:16 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Dec 20, 2005 5:29 pm
Posts: 16
Geraint wrote:
Try a variation of :

Code:
<?php
 global $mosConfig_lang;
if ($mosConfig_lang=="language1") include_once("language1Template.php");
else if ($mosConfig_lang=="language2") include_once("language2Template.php");
?>


Do some tests with "echo" to get the right string to test against.

Geraint




Thanks for this simple solution, :-*

if we want to use more than 2 laungages say 4;
what changes should be made to the syntax  ;)

I am using a wrapper to wrap an external gallery (4images)
the problem is that I have to change language two times; one on the site and again inside the wrapper, how can I define different urls for different lang….

like the button gallery will be …..index.php?lang=English  (for English content translated by mambelfish) and the same button will have index.php?=german for German content….  :'(

Thanks

_________________
http://www.ecard.lifeshore.com/
http://www.hotdt.com/


Top
 Profile  
 
PostPosted: Mon Jan 23, 2006 6:51 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Aug 30, 2005 7:49 am
Posts: 36
Thanks Garaint for sending me here.  Hooray, the right thread.

To take this further then, is the english template, just the index.php with a name change and some extra code / modifications to include (point to) the right template in templates? Or am I barking up the wrong tree?

Thanks

Jeremy


Top
 Profile  
 
PostPosted: Mon Jan 23, 2006 7:59 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Fri Aug 19, 2005 5:23 pm
Posts: 557
Location: Gogledd Cymru
You could have a trivial index.php template file that just loads the correct language specific template. 

Your trivial template would only contain the following:

global $mosConfig_lang;
if ($mosConfig_lang=="language1") include_once("language1Template.php");
else if ($mosConfig_lang=="language2") include_once("language2Template.php");
?>

The true template would be the language1Template.php and language2Template.php

_________________
email: opensourcematters at copynDOTplusDOTcom


Top
 Profile  
 
PostPosted: Mon Jan 23, 2006 9:05 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Dec 20, 2005 5:29 pm
Posts: 16
Geraint wrote:
Try a variation of :

Code:
<?php
 global $mosConfig_lang;
if ($mosConfig_lang=="language1") include_once("language1Template.php");
else if ($mosConfig_lang=="language2") include_once("language2Template.php");
?>


Do some tests with "echo" to get the right string to test against.

Geraint


sorry for asking again  ;) is it possible to have a 3rd or even 4th language? how should the code modified?
Thanks

_________________
http://www.ecard.lifeshore.com/
http://www.hotdt.com/


Top
 Profile  
 
PostPosted: Wed Jan 25, 2006 2:08 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Aug 30, 2005 7:49 am
Posts: 36
Hi there

I tried the above but I get an error  ???

'Fatal error: Call to undefined function: mosloadmodules() in /home/wwwnery/public_html/world/templates/neryaakov_english/index_en.php on line 33

I get the requested template but it crashes at line 33

the call is to user5.

It works if I stick the file back in as Index but not as a side shoot of the index file as modified above above (with obvious file changes)

thanks for your help 

PLEASE IGNORE THIS - I FOUND MY ANSWER


Last edited by BenDov on Wed Jan 25, 2006 4:27 pm, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 



Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group