Be careful with WYSIWYG modules + Smarty

I’ve been using both tckEditor and tinyMCE for some time now, both available as OXID modules in the eXchange somewhere. Some Smarty support may be available in these modules, but be wary! My experience is that the support is only 1-way and limited at that. That is, when you enter smarty into the templates, it may get saved correctly. But next time you load the content the smarty code can get munged-up when parsed by the WYSIWYG. There are also scenarios where the WYSIWYG will just munge your smarty code, regardless, so no amount of fixing before saving will help. This is bad news because users, who may not even be aware of smarty code, may use the CMS to edit some simple text (never touching or even seeing the smarty content) then hit save, only to find that their page no longer loads.

The problem is that WYSIWYG editors are designed to work with well-formed XHTML code, and simply do not adapt to anything else. The only solution here is to convert the smarty code into compliant XHTML form. For those who are interested, a tinyMCE plugin that does just that is available here, through SourceForge. But it too is limited. According to the comments, it can’t handle smarty code within html tags. But for anything else, this plug-in will maintain your smarty code.

Basically, the plug-in converts all smarty code to html comments, which is now valid XHTML and, because they are comment tags, won’t be touched by the WYSIWYG.

I’m working on my own module (tinyMCE based) that will also handle smarty embedded within html tags, as well as several other improvements over the SourceForge plug-in. When I’m done, I’ll place it in the eXchange.

Hi Shaun,

veeery interesting, thanks for that.

Would you mind me poking you to a very interesting community based development going on for admin panel 2.0? Some of us sat together on the last week end for a kick off.
If you want, come on over to the mailing list posted there. Also, there is a Skype group for immediate chats - of course, there’d be a time shift :wink:

Just let me know if you were interested joining.

Regards

@spurvis:

Please have a look at this (my) module:
http://www.oxid-esales.com/en/exchange/extensions/wendnet-ckeditor-incl-kcfinder-oxid

It has a built-in solution for your problems with smarty-tags (and some more nice features)! :slight_smile:

Greetings
Sascha