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

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


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.

Site Admin
Site Admin
Posts: 6153
Joined: Jan 7th, '09, 23:18

Re: HOW to add a new WYSIWYG editor to Modules

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


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

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}”