[Solved] Content not showing from Smarty variable

Forum rules
Only administrators can post or move items here.
Post Reply
Patrick32
New Member
New Member
Posts: 2
Joined: Sat Jul 04, 2015 11:10 am

[Solved] Content not showing from Smarty variable

Post by Patrick32 »

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

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}
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
◾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
Last edited by Patrick32 on Tue Jul 07, 2015 6:06 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: Content not showing from Smarty variable

Post 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 http://forum.cmsmadesimple.org/viewtopi ... =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.
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.
Patrick32
New Member
New Member
Posts: 2
Joined: Sat Jul 04, 2015 11:10 am

Re: [Solved] Content not showing from Smarty variable

Post by Patrick32 »

Hi

This solved the problem. Thank you.

Regards
JM
Post Reply

Return to “Closed Issues”