Page 1 of 1
Fatal error with Smarty syntax and custom content module
Posted: Wed May 17, 2006 2:51 pm
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

Re: Fatal error with Smarty syntax and custom content module
Posted: Wed May 17, 2006 8:39 pm
by calguy1000
Upgrading to the latest and greatest customcontent (nightly snapshot should work). will solve this problem.
Re: Fatal error with Smarty syntax and custom content module
Posted: Thu May 18, 2006 4:20 pm
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

)
Re: Fatal error with Smarty syntax and custom content module
Posted: Fri May 19, 2006 1:08 am
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.
Re: Fatal error with Smarty syntax and custom content module
Posted: Fri May 19, 2006 1:11 pm
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?
Re: Fatal error with Smarty syntax and custom content module
Posted: Fri May 19, 2006 4:27 pm
by calguy1000
are you using 0.13?
because smarty caching was disabled in 0.13
Re: Fatal error with Smarty syntax and custom content module
Posted: Sun May 21, 2006 12:40 am
by monghidi
Yes, I'm using 0.13-beta4 --
Thanks!