Clarification on how Global Content Blocks work now with 1.5.3b

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
joecannes
Forum Members
Forum Members
Posts: 93
Joined: Mon Nov 26, 2007 5:00 pm

Clarification on how Global Content Blocks work now with 1.5.3b

Post by joecannes »

Hi all,

Forgive my ignorance, but I just need clarification on how Global Content Blocks work now with 1.5.3b:

1. I am creating an English/French bilingual site, where my KEY (set in my config_lang.php file ) is 'eng' for English and 'fra' for French.

2. In my templates,  I have this code for my title:

Code: Select all

<title>{title} - {global_content name="sitename-$lang"}</title>
3. and now, under global content blocks, I shoudl create 2 GCBs now, 1 called "sitename-eng" and the other "sitename-fra" ?

Is this the correct workflow?

JC
alby

Re: Clarification on how Global Content Blocks work now with 1.5.3b

Post by alby »

joecannes wrote:

Code: Select all

<title>{title} - {global_content name="sitename-$lang"}</title>
3. and now, under global content blocks, I shoudl create 2 GCBs now, 1 called "sitename-eng" and the other "sitename-fra" ?

Is this the correct workflow?
No, $lang is the same of original: en_US, fr_FR, it_IT, ....
your GCB will be:  sitename-en_US  and  sitename-fr_FR

Alby
joecannes
Forum Members
Forum Members
Posts: 93
Joined: Mon Nov 26, 2007 5:00 pm

Re: Clarification on how Global Content Blocks work now with 1.5.3b

Post by joecannes »

Hi Alby,

Thanks for the clarification, I got it working this way as well, and I have not had any problems yet:

This is my config_lang.php:

Code: Select all

define('DEFAULT_LANG', 'eng');

$hls = array(

 'eng' => array(
	'block'=>'en',
	'flag'=>'<img src="/path_cms_root/images/lang/canada_en.png" style="border:0; opacity:1;" alt="English" />',
	'text'=>'English',
 ),
 'fra' => array(
	'block'=>'fr',
	'flag'=>'<img src="/path_cms_root/images/lang/canada_fr.png" style="border:0; opacity:1;" alt="Français" />',
	'text'=>'Français',
	'locale'=>'fr_FR.utf8@euro',
 ),

);
?>
and this is the section of my template calling the content block:

Code: Select all

{global_content name="footer-$lang"}
with my global content blocks labelled as "footer-eng" and "footer-fra".

The reason I dont use en_US is because I am building Canadian websites, so I try to keep it just "eng" and "fra" so there is country association.

Thanks!

Jimmy
alby

Re: Clarification on how Global Content Blocks work now with 1.5.3b

Post by alby »

joecannes wrote: Thanks for the clarification, I got it working this way as well, and I have not had any problems yet:
Now, but after you have problem if you use {search lang=$lang}, {news lang=$lang} or {whatever lang=$lang} ....

View carefully config_lang.php.alby.label (it's that you use)
you have locale_cms: 'locale_cms'=>'en_US', or 'locale_cms'=>'fr_FR', in all languages .....
This is the correct $lang

Alby
joecannes
Forum Members
Forum Members
Posts: 93
Joined: Mon Nov 26, 2007 5:00 pm

Re: Clarification on how Global Content Blocks work now with 1.5.3b

Post by joecannes »

Thanks Alby,

I will label them accordingly for the GCBs being called from my templates.

Question then, can I use "en_CA" and "fr_CA" for my locales, as my work is primarily for Canadians ?

and when I look at the file "en_US.nls.php" (in the admin > lang folder ) I see this script block (line 37 to 43)

Code: Select all

#Possible aliases for language
$nls['alias']['en'] = 'en_US';
$nls['alias']['english'] = 'en_US' ;
$nls['alias']['eng'] = 'en_US' ;
$nls['alias']['en_CA'] = 'en_US' ;
$nls['alias']['en_GB'] = 'en_US' ;
$nls['alias']['en_US.ISO8859-1'] = 'en_US' ;
Where would I use these possible aliases? (specifically, the "eng" and "en_CA" alias)?


JC
Last edited by joecannes on Thu Apr 09, 2009 6:47 pm, edited 1 time in total.
alby

Re: Clarification on how Global Content Blocks work now with 1.5.3b

Post by alby »

joecannes wrote: I will label them accordingly for the GCBs being called from my templates.

Question then, can I use "en_CA" and "fr_CA" for my locales, as my work is primarily for Canadians ?
locale_cms is necessary for loading correct language files (if you look in any modules you see many language files en_US.php, fr_FR.php, it_IT.php) and if you use 'label' (ex: eng, fra) cmsms don't know exactly what loading.
If you want a customized language en_CA you must copy all en_US.php in en_CA.php but I don't see any advantage for this.
Remember that con label no one sees these

Alby
joecannes
Forum Members
Forum Members
Posts: 93
Joined: Mon Nov 26, 2007 5:00 pm

Re: Clarification on how Global Content Blocks work now with 1.5.3b

Post by joecannes »

Gotcha! Thanks for the explanation of it all, now understand it more clearer.


JC
Locked

Return to “[locked] CMSMS MLE fork”