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

[Solved] Content not showing from Smarty variable
https://forum.cmsmadesimple.org/viewtopic.php?f=84&t=73148
Page 1 of 1

Author:  Patrick32 [ Sun Jul 05, 2015 7:47 pm ]
Post subject:  [Solved] Content not showing from Smarty variable

Hi,

I ran I little problem after upgrading from CMSMS 2.0 Beta 3 to CMSMS 2.0 RC1.

I am using Simplex theme.

After upgrading I received error: cannot find function encoding() etc.. which I found pointing to
\$1:
<meta charset='{$nls->encoding()}' />

I set this as comment line and after this the frontend was loading up except missing all content.

When I changed for example
\$1:
{$main_content nocache}
->
\$1:
{content}
content was shown ok.

So it seems
\$1:
{content assign='main_content'}
does not set variable main_content.

For me it seems that Smarty is not working correctly?

Does anybody know why this could be happening?


This is running on shared hosting.
----------------------------------------------

Cms Version: 2.0-rc1

Installed Modules:
◾AdminSearch: 1.0
◾CMSContentManager: 1.0
◾DesignManager: 1.0
◾FileManager: 1.5
◾MicroTiny: 2.0
◾ModuleManager: 2.0
◾Navigator: 1.0
◾News: 2.50
◾Search: 1.50
◾FormBuilder: 0.8.1.1
◾CMSMailer: 5.2.4
◾CGExtensions: 1.48.5
◾CGSimpleSmarty: 2.0
◾CGJobMgr: 1.3.4
◾NMS: 2.9.5


Config Information:
◾php_memory_limit:
◾max_upload_size: 128000000
◾url_rewriting: mod_rewrite
◾page_extension:
◾query_var: page
◾auto_alias_content: true
◾locale:
◾set_names: true
◾timezone: Europe/Helsinki
◾permissive_smarty: false

Php Information:
◾phpversion: 5.4.37
◾md5_function: On (True)
◾json_function: On (True)
◾gd_version: 2
◾tempnam_function: On (True)
◾magic_quotes_runtime: Off (False)
◾E_STRICT: 0
◾E_DEPRECATED: 0
◾test_file_timedifference:
◾test_db_timedifference:
◾memory_limit: 128M
◾max_execution_time: 30
◾output_buffering: On
◾file_uploads: On (True)
◾post_max_size: 128M
◾upload_max_filesize: 128M
◾session_save_path: /tmp (1777)
◾session_use_cookies: On (True)
◾xml_function: On (True)
◾xmlreader_class: On (True)

Performance Information:
◾allow_browser_cache: On (True)
◾browser_cache_expiry: 60
◾php_opcache: Off (False)
◾smarty_cache: On (True)
◾smarty_compilecheck: Off (False)
◾smarty_cache_udt: On (True)
◾auto_clear_cache_age: On (True)

Server Information:
◾Server Api: cgi-fcgi
◾Server Db Type: MySQL (mysqli)
◾Server Db Version: 5.5.42
◾Server Db Grants: Could not find a suitable "GRANT ALL" permission. This may mean you could have problems installing or removing modules. Or even adding and deleting items, including pages
◾Server Time Diff: No file system time difference found

----------------------------------------------

Thanks.

Regards,
JM

Author:  calguy1000 [ Sun Jul 05, 2015 11:52 pm ]
Post subject:  Re: Content not showing from Smarty variable

This is not a bug, per say. it is because we are now using the stock smarty system that uses smarty scopes. I have discussed it here http://forum.cmsmadesimple.org/viewtopic.php?f=1&t=72963

Because CMSMS divides a default page template into three 'sub' templates and processes them in this order:
a: the section above the <head> tag
b: the section below the </__body> tag
c: the head section

Variables created in section a, or b (or any of the GCB's, plugins, modules or other included templates) are not automatically given global scope.

That's why you need to use the 'scope=global' attribute when assigning variables, or use the new {share_data} plugin included with 2.0.

Author:  Patrick32 [ Tue Jul 07, 2015 6:43 am ]
Post subject:  Re: [Solved] Content not showing from Smarty variable

Hi

This solved the problem. Thank you.

Regards
JM

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