Page 1 of 1

[SOLVED] Conflict between {$lang} and CGCalendar?

Posted: Thu Sep 30, 2010 3:32 pm
by nicks
Hi!

Config :
CMSMS MLE : 1.8.2 toliara
CGCalendar : 1.5.5

I'm making a multilingual site. I have to use images as title, so i needed a solution to change the image depending on the language.

I've found that solution that works great ...


... So it works great... except on pages where the CGCalendar is displayed.

On those pages, the lang param on images is replaced by : Array =>

So i think, there is a conflict between {$lang} and CGcalendar, but i don(t know how to fix it...

Thanks!

Re: Conflict between {$lang} and CGCalendar?

Posted: Thu Sep 30, 2010 3:35 pm
by calguy1000
We do not support CMSMS MLE.

Re: Conflict between {$lang} and CGCalendar?

Posted: Thu Sep 30, 2010 3:56 pm
by nicks
Ok... I suppose that means "don't waste your time"...

Re: Conflict between {$lang} and CGCalendar?

Posted: Thu Sep 30, 2010 9:50 pm
by Milhaus
Please post your report to the MLE section. Perhaps there will be someone, who will be able to help you.

Re: Conflict between {$lang} and CGCalendar?

Posted: Fri Oct 01, 2010 6:46 am
by Peciura
I have tested {$lang} on page before {CGCalendar} and in calendar template - everything looks ok. What is your template ?

In case it really interferes you could save {$lang} value to temp variable and use it inside CGCalendar.

Code: Select all

{assign var='cgc_lang' value=$lang}
   {cms_module module="CGCalendar" display='calendar'}
{assign var='lang' value=$cgc_lang}

Re: Conflict between {$lang} and CGCalendar?

Posted: Fri Oct 01, 2010 9:07 am
by nicks
Hi! Thanks for the replies. Actually, "Jean le Chauve" on the french forum, solved my problem by creating an UDT.
The condition is that URL Rewrite is turned on and makes something like that : "mydomain.com/en_USA/mypage", "mydomain.com/fr_FR/mypage" etc...

So, this is the UDT content :

Code: Select all

$pageURL = 'http';
$lang = '';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
 $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
 $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
if (strpos($pageURL, '/fr_FR/') > 0) $lang = 'fr_FR';
elseif (strpos($pageURL, '/en_USA/') > 0) $lang = 'en_US';

// Add other languages here...

global $gCms;
$smarty = &$gCms->GetSmarty();
$smarty->assign('suffixeImage', $lang);
Then in my template (or page) i call the udt and the image like this :

Code: Select all

{myUDT}<img src="images/imagename-{$suffixeImage}.jpg" />
And that's all!

You can follow the entire discussion (in french) here :

http://www.cmsmadesimple.fr/forum/viewtopic.php?id=2951