Page 1 of 1

[Solved] Content not showing from Smarty variable

Posted: Sun Jul 05, 2015 7:47 pm
by Patrick32

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

Code: Select all

<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

Code: Select all

{$main_content nocache}

Code: Select all

content was shown ok.

So it seems

Code: Select all

{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
◾CMSMailer: 5.2.4
◾CGExtensions: 1.48.5
◾CGSimpleSmarty: 2.0
◾CGJobMgr: 1.3.4
◾NMS: 2.9.5

Config Information:
◾max_upload_size: 128000000
◾url_rewriting: mod_rewrite
◾query_var: page
◾auto_alias_content: true
◾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)
◾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




Re: Content not showing from Smarty variable

Posted: Sun Jul 05, 2015 11:52 pm
by calguy1000
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 ... =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.

Re: [Solved] Content not showing from Smarty variable

Posted: Tue Jul 07, 2015 6:43 am
by Patrick32

This solved the problem. Thank you.