CMS Made Simple Forums
https://forum.cmsmadesimple.org/

[SOLVED] Conflict between {$lang} and CGCalendar?
https://forum.cmsmadesimple.org/viewtopic.php?f=41&t=47803
Page 1 of 1

Author:  nicks [ Thu Sep 30, 2010 3:32 pm ]
Post subject:  [SOLVED] Conflict between {$lang} and CGCalendar?

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 i think, there is a conflict between {$lang} and CGcalendar, but i don(t know how to fix it...

Thanks!

Author:  calguy1000 [ Thu Sep 30, 2010 3:35 pm ]
Post subject:  Re: Conflict between {$lang} and CGCalendar?

We do not support CMSMS MLE.

Author:  nicks [ Thu Sep 30, 2010 3:56 pm ]
Post subject:  Re: Conflict between {$lang} and CGCalendar?

Ok... I suppose that means "don't waste your time"...

Author:  Milhaus [ Thu Sep 30, 2010 9:50 pm ]
Post subject:  Re: Conflict between {$lang} and CGCalendar?

Please post your report to the MLE section. Perhaps there will be someone, who will be able to help you.

Author:  Peciura [ Fri Oct 01, 2010 6:46 am ]
Post subject:  Re: Conflict between {$lang} and CGCalendar?

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.
\$1:
{assign var='cgc_lang' value=$lang}
   {cms_module module="CGCalendar" display='calendar'}
{assign var='lang' value=$cgc_lang}

Author:  nicks [ Fri Oct 01, 2010 9:07 am ]
Post subject:  Re: Conflict between {$lang} and CGCalendar?

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 :
\$1:
$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 :

\$1:
{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

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/