Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Template Language Switch Problem

Template Language Switch Problem

Hey there,

I have a question about switching templates for languages. :) It's a bit tricky and I've done some searches but I can't find anything right now. (Full Disclosure: I quit smoking last night and, while very very proud I'm doing that...my head is spinning right about now. Please be gentle... :) )

I have a different front page than the rest of the site template for the back-end/articles. Basically, I just want to switch only the front page template depending on the language selection - the back end template needs no switching.

Is there any way to specify only to switch the template for the front page/home page depending on the language, and not to switch the templates for the entire site?

Thanks for any info,

Nat. :)

natharari
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Template Language Switch Problem

Hi Nat,

congrats on giving up smoking... I hope the last week has gotten better for you than that first day was!

Yes, you can switch just the front page. I'd do it like this in MetaTemplate:

if ($core_genius->check("pagetype = frontpage")) {
  if ( $language_code == "fr" ) return "mytemplate1";
  if ( $language_code == "de" ) return "mytemplate2";
// add more as appropriate...
}

This assumes that you are using the standard Joomla "frontpage" view as the front page of your site. If you're using something else (e.g. an article view or some other component) then you'll need to change the PHP a little, but it's usually not too arduous. Just write back with details of your setup.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: Template Language Switch Problem

Wow, it's been almost exactly a month and I forgot to thank you for your reply, Stephen. We sort of got a ton of different and new work to do which had to be finished first, so I never even got back to you.

However, first: thank you for your reply (albeit a bit late). smile

Second, I am using a customized template for the front page. I can email you the link if you like and you can see. I did add the code and I'm going to give it a try tonight (as it's sort of on display during the day atm with our board of directors meeting and I don't want to embarrass myself). If you like, please email me at: n a th a rari +ATT+ gmail and I can send you the link to the front page and ask you about it? I would greatly appreciate it. smile

Thank you so much for any help and again, sorry about the major delay in replying and thanking you. It really got pushed to the back burner a few hours after I posted.

Nat.

natharari
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Template Language Switch Problem

Hi Nat,
sorry it's taken a few days to respond to this. If you're still needing assistance with this can you let me know and I'll look into it for you.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: Template Language Switch Problem

Hello Stephen, great job, my trouble is simple but I can not find solution:
1-install metatemplate  OK
2-create two main menu OK (one origianl form install)
3-according language of browse the metatemplate change the mainmenu and then I redirect from them(the options of the main menu) to achieve a two language (Spanish and English site) site, the matter I have is i can make the second main menu (the joomla 1.5 spanish pack is already installed if matters) doesn´t display, when I redirect for fail show me the first main menu(original in English), if I cancel "redirect for failing" it shows nothing in the main menu. Any clue to make it shoes the second main menu I create and will display according the rule(just one I have and I need) that apply (the language of the browser). There is no extension and plug-in it is empty almost the installation.
have a nice day and good Bye.

tsftprograma
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Template Language Switch Problem

Hi tsftprograma,

I'm sorry I am having some trouble understanding what you are asking for. Would you like to write in Spanish and I'll try Google Translate?

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: Template Language Switch Problem

Hello, It will be a honour matter to me being no able to explain in such a language like English.

Let´s start again:

Objective: make a site bilingual without too work I am just one.

I have  installed Metatemplate and databases too on Joomla 1.5/win 7/apache 2
I set just one rule: in this rule I set to change template (despite I mainly interested in chain defualt main menu in the front page), it change template fine, but when comes the moment to change the defualt main menu( to set as active default main menu another than defualt one) the page doesn´t display menu (I disable the option to redirect on failing otherwise disply always the default main menu from factory), something like the metatemplate change me the template, then comes to change the default main menu as I have configured in the only exiting rule and it fails there.

I am really sure you understand now: defualt main menu doesn´t change to the second main menu I have created and I have just one rule, the matter of the template is secondary and runs best (I had the blue template and I set purity in metatemplate, it changes it without complaint), the issue is: "the defualt main menu's change fails" and I know something is made wrong by me and I do not know what. I give an image in my blog to the setting of menu on the rule:
http://tsftprogramacion.blogspot.com/20 … html#links

tsftprograma
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: Template Language Switch Problem

Hi tsftprograma,

First of all, I would recommend that you take a look at JoomFish (http://www.joomfish.net/) for handling multi-lingual sites. It's not necessarily perfect for every style of site, but you should at least evaluate it to see if it suits your needs.

Assuming that you don't want to go the JoomFish route, however:

I see from the screenshot that you are doing the following in the SUCCEED action:

1 - Setting default menu item to "opciones"
2 - Setting active menu item to "opciones"
3 - Unpublishing the entire menu that contains the "opciones" menu item.

I think that the problem here is that you are unpublishing all the menu items in "Opciones menu". This means that your new default menu item becomes unpublished! That's why it does not work.

Typically, if you have 2 different languages with different menu items, then when you detect one language you would disable the menu items from the *other* language, and vice versa.

Does that help?

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: Template Language Switch Problem

Thank you ver much for your time, I have now in a break, I also test m17n (somethinlike this name) and show me directly no menu (it´s tailored to make multilingual), so I will keep monolingual for a while and continue soon, then maybe try joomfish. Have a nice day.

tsftprograma
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5910
Total Posts Today:
1
User Info:
 
Total Users:
10144
Newest User:
leonard5412396
Members Online:
2
Guests Online:
150


Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked