Fatal error with Smarty syntax and custom content module

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
kranf

Fatal error with Smarty syntax and custom content module

Post by kranf »

hello,  I am French and I use the CustomContent module to post different contents on my pages according to the user.
The module functions correctly  when I use it how tags. On the other hand I have an error if I use the smarty syntax. :
Fatal error: Smarty error: [in content:content_en line 1]: syntax error: unrecognized tag 'customcontent_loginname' (Smarty_Compiler.class.php, line 580) in /var/www/html/madesimple/lib/smarty/Smarty.class.php on line 1095

???
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Fatal error with Smarty syntax and custom content module

Post by calguy1000 »

Upgrading to the latest and greatest customcontent (nightly snapshot should work). will solve this problem.
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.
monghidi

Re: Fatal error with Smarty syntax and custom content module

Post by monghidi »

Sorry, calguy -- thanks for this GREAT module -- but smarty tags don't seem to work at all for me, using the 1.4.1 module and CMSMS 13b4. I get the same fatal error kranf described. Nightly snapshot is (still) the 1.4.1 version?

Any tips? It works fine using the comment tags but is harder to manage in the code and more limited (to me  :-X)
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Fatal error with Smarty syntax and custom content module

Post by calguy1000 »

okay, in my setup, customcontent 1.4.1, the following code works:

Code: Select all

{cms_module module=CustomContent}
{get_template_vars}
<hr/>
{if $customcontent_memberof_test1 == "1" }
<h1>You're a good guy</h1>
{else}
<h1><font color="red">You're a bad guy</font></h1>
{/if}
and this:

Code: Select all

{cms_module module=CustomContent}
{if $customcontent_loggedin eq 1}
Welcome, you are an authorized user<br/>
{else}
You are not logged in
{/if}
the syntax was driving me nuts for a bit (smarty expressions). so I thought I'd throw a couple of more examples up.
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.
monghidi

Re: Fatal error with Smarty syntax and custom content module

Post by monghidi »

Thanks again, calguy. These work in my setup, too, with one last problem:

Logging in and logging out work great syntax-wise. I have only two test groups, each with one user.
Here's the problem: If I log out, and log back in as a different user, the page acts as if I am NOT logged in unless I either
  1) use the admin side to edit the page and resubmit, or
  2) use the admin tool to clear the cache.

Seems the smarty variables are being cached? Is this controllable somehow? Any thoughts?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Fatal error with Smarty syntax and custom content module

Post by calguy1000 »

are you using 0.13?

because smarty caching was disabled in 0.13
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.
monghidi

Re: Fatal error with Smarty syntax and custom content module

Post by monghidi »

Yes, I'm using 0.13-beta4 --

Thanks!
Last edited by monghidi on Sun May 21, 2006 12:42 am, edited 1 time in total.
Locked

Return to “CMSMS Core”