I updated CF tinyMCE with a small nicety. It now automatically handles multiple instance per page. Previously, it would have to be invoked like so:
<cfoutput>
<tr>
<td>
#application.includes.tinymce(
content=read.en,
element="en",
csswidth="444px",
resizing=true,
theme='advanced',
theme_advanced_buttons1 = "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,bullist,numlist,|,undo,redo,|,code,cleanup",
theme_advanced_buttons2 = "",
theme_advanced_buttons3 = ""
)#
</td>
<td>
#application.includes.tinymce(
content=read.es,
element="es",
csswidth="444px",
resizing=true,
theme='advanced',
loadbase='0',
language='es',
theme_advanced_buttons1 = "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,bullist,numlist,|,undo,redo,|,code,cleanup",
theme_advanced_buttons2 = "",
theme_advanced_buttons3 = "",
gecko_spellcheck = "false"
)#
</td>
</tr>
</cfoutput>
Notice the ‘loadbase=0′ argument on the second invocation. That told the previous version of CF TinyMCE to not all of TinyMCE again – just load the settings instead.
The new version automatically handles multiple instances and not loading TinyMCE all over again for subsequent invocations on the same page. Therefore, the new syntax example is:
<cfoutput>
<tr>
<td>
#application.includes.tinymce(
VScope=Variables,
content=read.en,
element="en",
csswidth="444px",
resizing=true,
theme='advanced',
theme_advanced_buttons1 = "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,bullist,numlist,|,undo,redo,|,code,cleanup",
theme_advanced_buttons2 = "",
theme_advanced_buttons3 = ""
)#
</td>
<td>
#application.includes.tinymce(
VScope=Variables,
content=read.es,
element="es",
csswidth="444px",
resizing=true,
theme='advanced',
language='es',
theme_advanced_buttons1 = "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,bullist,numlist,|,undo,redo,|,code,cleanup",
theme_advanced_buttons2 = "",
theme_advanced_buttons3 = "",
gecko_spellcheck = "false"
)#
</td>
</tr>
</cfoutput>
No more loadbase! The key is the argument “Vscope=Variables”. That lets CF pass the Variables scope back and forth between a page and a function. It is a required argument which I am not happy about. But since it’s value never changes it’s not so bad.
Because of this fundamental change, CF TinyMCE 090612 is not backwards compatible. If anyone knows how to pass the Variables scope back and forth between a page and a function, without an argument like I am here – please let me know!
You can download CF TinyMCE at github: http://github.com/WebVeteran/cf-tinymce/
CF TinyMCE, ColdFusion, TinyMCE
CFC, coldfusion function, vScope
Recent Comments