Full-service Internet Marketing & Web Development
Recent Posts

Sponsors
![]() |
TinyMCE convert_urls patchDawn Rossi, 07-07-2009 |
TinyMCE is a popular WYSIWYG (What You See Is What You Get) online html editor.
We use TinyMCE throughout the SPI platform, for easy editing of autoresponder messages and email broadcasts.
One issue we recently experienced with TinyMCE is its internal 'convert_urls' feature, whereby TinyMCE attempts to clean up urls (href's) so that they comply to a certain format.
This feature clashed with SPI's Dynamic Fields, a feature that automatically populates data into a message, based on the recipient information.
As an example, we allow users to enter links in this format:
http://www.MyDomain.com/?aff_id={%aff_id : 1234%}
or
http://{%website : www.MyDomain.com%}
Where {% %} identifies the dynamic tag and the colon : lists the default value.
{%SomeField : DefaultValue%}
TinyMCE would strip the DefaultValue and garble the links.
We tried turning off convert_urls, relative urls, cleanup and a few other options, but nothing helped.
The patch is to completely turn-off url_convertor in the TinyMCE source code.
Open tiny_mce.src and locate this line:
:case"href":if(j.keep_values){if(&& j.url_converter)
Change it to:
:case"href":if(j.keep_values){if( 0 && j.url_converter)
Now find the section that begins with:
convertURL:function(q,x,w){var r=this,v=r.settings;
And change it to:
convertURL:function(q,x,w){return q;var r=this,v=r.settings;
-
In our case we had *.js caching turned on with the web-server. To force users to re-download the file, had to rename the folder name from /tiny_mce to /tiny_mce_patched
We use TinyMCE throughout the SPI platform, for easy editing of autoresponder messages and email broadcasts.
One issue we recently experienced with TinyMCE is its internal 'convert_urls' feature, whereby TinyMCE attempts to clean up urls (href's) so that they comply to a certain format.
This feature clashed with SPI's Dynamic Fields, a feature that automatically populates data into a message, based on the recipient information.
As an example, we allow users to enter links in this format:
http://www.MyDomain.com/?aff_id={%aff_id : 1234%}
or
http://{%website : www.MyDomain.com%}
Where {% %} identifies the dynamic tag and the colon : lists the default value.
{%SomeField : DefaultValue%}
TinyMCE would strip the DefaultValue and garble the links.
We tried turning off convert_urls, relative urls, cleanup and a few other options, but nothing helped.
The patch is to completely turn-off url_convertor in the TinyMCE source code.
Open tiny_mce.src and locate this line:
:case"href":if(j.keep_values){if(&& j.url_converter)
Change it to:
:case"href":if(j.keep_values){if( 0 && j.url_converter)
Now find the section that begins with:
convertURL:function(q,x,w){var r=this,v=r.settings;
And change it to:
convertURL:function(q,x,w){return q;var r=this,v=r.settings;
-
In our case we had *.js caching turned on with the web-server. To force users to re-download the file, had to rename the folder name from /tiny_mce to /tiny_mce_patched
|
|
Subscribe Now to receive new posts via Email as soon as they come out.
Comments
Post your comments

