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

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
nicks
New Member
New Member
Posts: 6
Joined: Thu Sep 30, 2010 3:23 pm

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

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

Thanks!
Last edited by nicks on Fri Oct 01, 2010 9:08 am, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Conflict between {$lang} and CGCalendar?

Post by calguy1000 »

We do not support CMSMS MLE.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
nicks
New Member
New Member
Posts: 6
Joined: Thu Sep 30, 2010 3:23 pm

Re: Conflict between {$lang} and CGCalendar?

Post by nicks »

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

Re: Conflict between {$lang} and CGCalendar?

Post by Milhaus »

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

Re: Conflict between {$lang} and CGCalendar?

Post 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}
nicks
New Member
New Member
Posts: 6
Joined: Thu Sep 30, 2010 3:23 pm

Re: Conflict between {$lang} and CGCalendar?

Post 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
Locked

Return to “[locked] CMSMS MLE fork”