• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC


Forum rules


Only administrators can post or move items here.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [Solved] scope=global
PostPosted: Mon Aug 24, 2015 8:23 pm 
Offline
Power Poster
Power Poster

Joined: Mon May 29, 2006 1:20 pm
Posts: 1946
Location: Rouen
Hi,

last rev 10109 Working on a multilingual web site FR, En, Es, De, with CGSimpleSmarty2.0

I use in the template at the top
\$1:
{process_pagedata}
{assign var='rootlang' cgsimple::get_root_alias() scope=global}
{global_content name="languagestrings_`$rootlang`"}
With some string translation on my template
But Have a lot of errors message on my translation (languagestrings)

To have no error message
I comment at the top atfer {process_pagedata}
{*assign var='rootlang' cgsimple::get_root_alias() scope=global*}
{*global_content name="languagestrings_`$rootlang`"*}
I must write after </__body>
{assign var='rootlang' cgsimple::get_root_alias()}
{global_content name="languagestrings_`$rootlang`"}
and write after <head>
{assign var='rootlang' cgsimple::get_root_alias()}
{global_content name="languagestrings_`$rootlang`"}

Is there a problem now (Smarty 3.1.16) with scope=global ?

_________________
Jean-Claude Etiemble


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: scope=global
PostPosted: Tue Aug 25, 2015 3:33 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8164
Location: Fernie British Columbia, Canada
First, your syntax is incorrect.

{assign var='rootlang' value=cgsimple::get_root_alias() scope=global} is the correct syntax.

Now. Given that there is a bug in CGSimpleSmarty for 2.0 (fixed in svn, thank you for the report). I tested this with other variable names at the top of my page template and it worked exactly as expected.

i.e: {assign var='test1' value='foo1' scope=global} or {$test2='foo2' scope=global}

note: that {assign var='test3' value='foo3'} (which does NOT have the global scope argument) also worked as expected. When I tried to reference the {$test3} variable in my page content the variable was not set and I got PHP notices.

_________________
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.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: scope=global
PostPosted: Tue Aug 25, 2015 5:54 pm 
Offline
Power Poster
Power Poster

Joined: Mon May 29, 2006 1:20 pm
Posts: 1946
Location: Rouen
Ok solved

On my tests
value=cgsimple::get_root_alias()
or
cgsimple::get_root_alias()
are same working

But I must write after <head> and </__body>
{global_content name="languagestrings_`$rootlang`"}

Thanks for correction on CGSimpleSmarty module

_________________
Jean-Claude Etiemble


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting