I have begun writing an interface module to use XStandard (www.xstandard.com) as WYSIWYG editor.
Unfortunately, XStandard, in an effort to write prefect XHTML code, translates all quotes to "& q u o t ;" which turns SMARTY directives unusable:
{cms_module module="News" makerssbutton"true"}
becomes to
{cms_module module=&News& makerssbutton=&true&}
Being new to SMARTY and CMSMS, can anyone make a suggestion on where to intercept the parsing process?
CMSMS and XStandard Editor: Problem with SMARTY tags
-
dfritschy
Solution found?
I have found the ContentPreRenderfunction and use it to unescape the escaped quotes within SMARTY tags. Maybe a RegExp Guru can provide a more robust solution?
It has been a very interesting experience with CMSMS and SMARTY so far. I'm impressed by the CMSMS module architecture!
Code: Select all
function ContentPreRender(&$content)
{
$search = '@\{.*?\}@';
$content = $tmp . preg_replace_callback(
$search,
create_function(
'$matches',
'return str_replace( """, \'"\', $matches[0] );'
),
$content
);
}
Re: CMSMS and XStandard Editor: Problem with SMARTY tags
Nice. Though, I would think something like: preg_replace('\{.*?\".*?\}', '\'');, though it would probably need a modifier. I'm sure your way is more than efficient enough, since it's only going to do it on non-cached pages.
Thanks for the kind words. The module API really IS one of our best features... besides the helpful community, of course.
Thanks for the kind words. The module API really IS one of our best features... besides the helpful community, of course.
-
mark_l_sanders
Re: CMSMS and XStandard Editor: Problem with SMARTY tags
I notice that the latest release version still suffers from this problem: XStandard still replaces the double quotes in SMARTY tags.
Does anyone know if the beta 1.0 has a fix for this?
Does anyone know if the beta 1.0 has a fix for this?
- Elijah Lofgren
- Power Poster

- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
Re: CMSMS and XStandard Editor: Problem with SMARTY tags
It looks like it was fixed in the latest SVN version of XStandard: http://viewsvn.cmsmadesimple.org/viewsv ... d&view=revmark_l_sanders wrote: I notice that the latest release version still suffers from this problem: XStandard still replaces the double quotes in SMARTY tags.
Does anyone know if the beta 1.0 has a fix for this?
Fix should be in the next release of XStandard.
Hope this helps,
Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 
-
mark_l_sanders
Re: CMSMS and XStandard Editor: Problem with SMARTY tags
Hey Elijah
Not sure if I did enough, but I just downloaded the latest version (21) of the xstandard.module.php file and copied it over the current version - the problem still exists, though.
Have I missed something - do I need to do more than just replace 1 file?? There is another file - imagelibrary.config.php - that's quoted as part of the fix, but I've no idea what to do with it!!
Not sure if I did enough, but I just downloaded the latest version (21) of the xstandard.module.php file and copied it over the current version - the problem still exists, though.
Have I missed something - do I need to do more than just replace 1 file?? There is another file - imagelibrary.config.php - that's quoted as part of the fix, but I've no idea what to do with it!!
Last edited by mark_l_sanders on Thu Nov 16, 2006 10:14 pm, edited 1 time in total.
Re: CMSMS and XStandard Editor: Problem with SMARTY tags
Did you try uninstall reinstall some times it helps when doing changes to .php...
-
mark_l_sanders
Re: CMSMS and XStandard Editor: Problem with SMARTY tags
Found a workaround.
http://forum.cmsmadesimple.org/index.ph ... l#msg32781
You just use single quotes instead of doubles. Worked fine.
Strange behaviour w/out the workaround, tho: worked fine when viewing the site, but when editing the page the preview didn't work - same errors as before...
http://forum.cmsmadesimple.org/index.ph ... l#msg32781
You just use single quotes instead of doubles. Worked fine.
Strange behaviour w/out the workaround, tho: worked fine when viewing the site, but when editing the page the preview didn't work - same errors as before...
Last edited by mark_l_sanders on Thu Nov 16, 2006 11:30 pm, edited 1 time in total.

