HOW to add a new WYSIWYG editor to Modules

Discuss everything related to ApPHP Durecty CMF. All versions. Any questions related to the Directy CMF developing or using should be posted to this forum.

Moderators: alexandrleonenko, alexmst

InsiteFX
Expert
Expert
Posts: 56
Joined: Jun 1st, '09, 07:19
Location: Bristol, CT. USA

HOW to add a new WYSIWYG editor to Modules

Postby InsiteFX » Jul 16th, '15, 05:57

Hi,

I notice that all the modules are using just a plain textarea for input, how would you add a WYSIWYG editor like ckeditor etc; To modules
for editing pages?

Thank you
Photoshop Designer - Custom Graphics, Icons and 300 Dpi Custom ebook covers, Software boxes, CD covers, DVD covers and Screens etc.

administrator
Site Admin
Site Admin
Posts: 6098
Joined: Jan 7th, '09, 23:18
Contact:

Re: HOW to add a new WYSIWYG editor to Modules

Postby administrator » Jul 20th, '15, 18:21

Hi!

Currently all wizards use only simple textarea, but you may easy add WYSIWYG editor by simple customization of the page.
Example:

At the top of the script:
<!-- register tinymce files -->
<?php A::app()->getClientScript()->registerScriptFile('js/vendors/tinymce/tiny_mce.js'); ?>
<?php A::app()->getClientScript()->registerScriptFile('js/vendors/tinymce/config.js'); ?>
<?php A::app()->getClientScript()->registerCssFile('js/vendors/tinymce/general.css'); ?>

At the bottom of the script:
A::app()->getClientScript()->registerScript('setTinyMceEditor', 'setEditor("page_text",'.(($errorField == 'page_text') ? 'true' : 'false').');', 2);


Return to “ApPHP Directy CMF {developers/users}”