Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

tinymce

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
stot
Smarty Rookie


Joined: 13 Nov 2006
Posts: 17

PostPosted: Thu Mar 25, 2010 1:57 am    Post subject: tinymce Reply with quote

Hi all,

I recently included tinymce into my project and tried to edit smarty templates within an browser editor. Nearly everything worked well except the access to objects like {$myObject->method}.

tinymce always replaces the > with the corresponding html entity >
Therefore the smarty code will no longer work and gives an error. This happens in the html view as well as in the wysiwyg view.

Does anybody know how to solve this issue?
Many thanks in advance.
Back to top
View user's profile Send private message Visit poster's website
scuzzy
Smarty Regular


Joined: 31 Aug 2003
Posts: 84

PostPosted: Fri Mar 26, 2010 5:46 am    Post subject: Reply with quote

Why not do a string translation once the document has been submitted, you could use regular expressions to match?

Code:
preg_replace('/({\\$[\\w]*?)->([\\w]*?})/','$1->$2',$html);
Back to top
View user's profile Send private message Visit poster's website
tgnc.org.uk
Smarty Rookie


Joined: 15 Mar 2010
Posts: 8

PostPosted: Tue Mar 30, 2010 8:46 am    Post subject: Reply with quote

Have you tried {$myobject.method} type construct?

I found I needed to {$smarty.server.REQUEST_URI} to get what I needed in a WYSIWYG.

TBH you should write your templates in plain text to avoid issues with the WYSIWYG adding or altering the content as it is treating all text as if its being displayed as a web page.

I have noted some rendering errors have been solved by simply reverting to a raw HTML or plain text interface.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP