TinyMCE randomly munging cms_selflink href's

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
banjoman
New Member
New Member
Posts: 9
Joined: Thu Jul 30, 2009 3:09 pm

TinyMCE randomly munging cms_selflink href's

Post by banjoman »

I have been having a recurring periodic problem with TinyMCE 2.5.4.  This happens in both CMSMS 1.5.4 and 1.6.5.

I will sometimes enter content in WYSIWYG mode and sometimes I prefer to use non-WYSIWYG because TinyMCE does not support all the CSS attributes I use.  Mostly it's well-behaved, but with infuriating regularity the following will occur.  I will have a link to an internal page, e.g.

Code: Select all

<div style="text-align: center"><a href="{cms_selflink href="Register"}"><img style="vertical-align: middle;" title="Register for the Summit" src="uploads/images/random.gif" alt="" width="46" height="20" /></a></div>
Sometime during the save or switching from one mode to another, the href will be lost, partially stripped out, as in:

Code: Select all

<div style="text-align: center"><a href="{cms_selflink href="><img style="vertical-align: middle;" title="Register for the Summit" src="uploads/images/random.gif" alt="" width="46" height="20" /></a></div>
Note that the selflink href has disappeared along with the closing double quote. curly bracket and double quote, leaving a single double quote!  Happens this way every time.  Normally it's not a big deal to re-enter it, but it becomes annoying when I have 8 or 10 internal links to retype.  The larger issue is that, at some point in the near future, I am going to be turning this over to the client who is not all that computer-savvy and who is going to panic the first time this happens when he tries to update a page and who will be unlikely to be able to fix it.

So, is this a bug or a feature?  Has anyone else encountered this?  Is there some configuration setting I've overlooked?

Alternatively, is there some other WYSIWYG editor plugin I could use other than TinyMCE?
----------------------------------
Last edited by banjoman on Fri Oct 02, 2009 2:06 am, edited 1 time in total.
jimkberry
New Member
New Member
Posts: 3
Joined: Thu Jan 17, 2013 4:35 pm

Re: TinyMCE randomly munging cms_selflink href's

Post by jimkberry »

I recognize this is an old, dead topic, but a friend of mine recently ran into exactly this problem (with MicroTiny instead of TinyMCE, of course) and this was really the only reference to it she found.

I figure someone else looking for a solution might also end up finding this thread and might be interested in what we found.

Basically, the issue appears to be that the editor (whether TinyMCE or MicroTiny) has no idea that the Smarty "{}" brackets are block delimiters and supposed to take precedence over all others. So it sees:

Code: Select all

<href="{cms_selflink href="Register"}">
and parses by angle brackets and then quotation marks, and gets:

Code: Select all

<    href="{cms_selflink href="    Register    "}"    >
I don't know what it does with what appear to it to be tag attributes: "Register" and "}", but it's not really important.

We have dealt with this by writing the tag as:

Code: Select all

<href="{cms_selflink href='Register'}">
using single quotes to delimit the Smarty tag parameter and it seems to work fine.

-jim
Post Reply

Return to “Modules/Add-Ons”