Scriptcase and tinyMCE with userdefined init parameter

Call tinyMCE in Scriptcase with your init-Settings

tinyMCE is a HTML editor plugin which can be used in own code.

Scriptcase already uses tinyMCE already to show and edit text/blob database fields with HTML formatting.
The developer can set several parameters for this, but not all, especially no plugins.

You could import another copy of tinyMCE and call the init for this.
Doing so, you’ll also have to take care of, when you deoply the application on a live server.

But there is an other way:
Use a standard text-field in Scriptcase, which is bound to a text(blob-field in the sql table.
Then convert this field into a tinyMCE-editor. For this we’ll need the id of the text field. You can get this for example in Chrome via the explore feature.

To do the conversion, add the following code into the onLoad event of the form:

Please replace the name of the text field in this code.
Our sample uses a text field named id_sc_field_text_1
Replace this name with the name of your text field.

Now you can add additional functions and plugin calling tinyMCE.

Here are two samples (please add the code before: $msg.=’content_style… einfügen)

or define own templates to be inserted at the cursor position in tinyMCE:

 

 

Posted in Scriptcase Sniplets Tagged with: , ,