Page 1 of 1

Getting smarty warnings because of {} brackets

Posted: Wed Nov 23, 2011 7:34 pm
by radon
Hi

I recently converted my old joomla page to cmsmadesimple (latest as of now) and run in the following problem:

On several pages, I see error messages, that smarty could not recognize certain tags, because it mistook them as tags, which they aren't. For example in some texts there are still some {mospagebreak title="whatever"} tags flying around which divided the joomla article in multiple pages. For this, I created an own custom tag which does nothing, so those get filtered out.

Now I have many articles, where the {} brackets are used in different kind of ways, some use it as clantags or whatelse.

My question is: How can I prevent smarty from throwing these errors?

Going through each article by hand is out of the question, they're just too many.

I don't use any custom modules yet, only my own UDTs which shouldn't interfere here.

Re: Getting smarty warnings because of {} brackets

Posted: Wed Nov 23, 2011 10:41 pm
by mrenigma
As far as I am aware if you are attempting to call Smarty tags/plug-ins which are not built or added onto CMSMS then you will get these errors.

I think the only thing you can do is go through and clear them all or alternatively look for plug-ins which you can add to CMSMS which will duplicate the Joomla functionality.

Cheers
mrenigma

Re: Getting smarty warnings because of {} brackets

Posted: Wed Nov 23, 2011 11:17 pm
by uniqu3
Use {ldelim} and {rdelim} for { } when it'S not smarty tag.

Re: Getting smarty warnings because of {} brackets

Posted: Wed Nov 23, 2011 11:31 pm
by Wishbone
If it's not feasable to modify all your pages, you might be able to leverage the "ContentPreCompile" event (Extensions -> Event Manager) and point it to a UDT that inserts {literal} and {/literal} around the content before rendering. I've never done this before.. just theoretical. The downside to this is that you can't use any smarty in your pages.

Re: Getting smarty warnings because of {} brackets

Posted: Thu Nov 24, 2011 12:17 am
by calguy1000
Or just manually implement stub UDT's for all of those joomla tags that are not compatible.

Re: Getting smarty warnings because of {} brackets

Posted: Thu Nov 24, 2011 12:45 am
by radon
Actually I'm getting a whole lot more errors, not all related to the brackets itself lately as I pick some articles at random and see what error messages smarty is throwing. For example this:

Code: Select all

string(142) "Smarty error: [in content:content_en line 188]: syntax error: expecting '=' after attribute name 'Tool' (Smarty_Compiler.class.php, line 1558)" string(146) "Smarty error: [in content:content_en line 188]: syntax error: expecting '=' after attribute name 'Tutorial' (Smarty_Compiler.class.php, line 1558)" string(145) "Smarty error: [in content:content_en line 188]: syntax error: expecting '=' after attribute name '(Teil2)' (Smarty_Compiler.class.php, line 1591)" string(142) "Smarty error: [in content:content_en line 269]: syntax error: expecting '=' after attribute name 'Tool' (Smarty_Compiler.class.php, line 1558)" string(146) "Smarty error: [in content:content_en line 269]: syntax error: expecting '=' after attribute name 'Tutorial' (Smarty_Compiler.class.php, line 1558)" string(145) "Smarty error: [in content:content_en line 269]: syntax error: expecting '=' after attribute name '(Teil3)' (Smarty_Compiler.class.php, line 1591)" 
I can't see any brackets there, apparently it even mistakes some characters or word parts as control structures? This is totally weird. I hope it'll be fixed as soon as I get rid of the smarty-parser inside my articles.

Anyone has seen this before?

Re: Getting smarty warnings because of {} brackets

Posted: Thu Nov 24, 2011 5:34 pm
by radon
Wishbone wrote:If it's not feasable to modify all your pages, you might be able to leverage the "ContentPreCompile" event (Extensions -> Event Manager) and point it to a UDT that inserts {literal} and {/literal} around the content before rendering. I've never done this before.. just theoretical. The downside to this is that you can't use any smarty in your pages.
Doesn't seem to work... I need some help with this.

I tried adding this as a UDT:

Code: Select all

$params['content'] = '{literal}'.$params['content'].'{/literal}';
var_dump($params['content']);

die('FUUU');
And added the tag to the event ContentPreCompile AND SmartyPreCompile.
Doesn't change a thing, apparently those aren't even called when compiling a smarty template.

I used an article which was not cached yet to test it out, so caching is not an issue here.

Any help? As it is right now, I can't use cmsms for my page, it just throws those damn errors around for any reason...

Re: Getting smarty warnings because of {} brackets

Posted: Tue Nov 29, 2011 4:00 pm
by radon
no ideas? ???

I really need help with this :'(