Hi,
I have no idea why this is happening since I was sure everything was working perfectly yesterday. I have a WYSIWYG field using LG_TinyMCE configured with forced_root_block : ‘p’ (by default) and this seems to mess things up when you want to use PHP in the template.
The template is set to allow PHP and the parsing stage is set on output. In a simple test where I do a <?php echo ‘{subpage_corner_box_text}’; ?> I get an parse error stating there is an unexpected T_STRING. If I do a <?php echo ‘test’; ?> I don’t get any errors. I have written test in the WYSIWYG field and can see that it contains test when using the HTML button from the options bar.
I can’t see how this is the fault of LG_TinyMCE.
I would assume that {subpage_corner_box_text} would just be replaced with text and since it is surrounded with quotes everything should be okay, but this doesn’t seem to be the case.
I need to get this fixed as soon as possible.
Moved to Extensions: Discussion and Questions by Moderator
Okay, I am getting closer to finding out what the real issue is. I disabled PHP to see what was being output for PHP to process and I could see that TinyMCE was NOT converting quotes into HTML entities. This made PHP barf up understandably. Now I need to configure LG_TinyMCE to do proper entity conversion. Any help is greatly appreciated.
Tried many different things and finally had to resort to a quick and dirty hack. If somebody has a better solution I would greatly appreciate it.
Here is my fix:
In tiny_mce_src.js at line 4230 add the following:h = h.replace(/[\']/g, '''); // Replace ' with entity number '
h = h.replace(/[\"]/g, '"'); // Replace " with entity number "
This fixed the output from TinyMCE, so I could use it with PHP. I haven’t experienced any problems with this, but others might have a different experience.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.