HOW TO add WYSIWYG editor to pages in Backend

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: ne_moj, alexmst, zewa, vadimako, ne_moj, alexmst, zewa, vadimako

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

HOW TO add WYSIWYG editor to pages in Backend

Postby administrator » Oct 14th, '17, 14:44

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

At the top of the script:

Code: Select all

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

At the bottom of the script:

Code: Select all

<?php A::app()->getClientScript()->registerScript('setTinyMceEditor', 'setEditor("textarea_element_id",'.(($errorField == 'textarea_element_id') ? 'true' : 'false').');', 2); ?>

where "textarea_element_id" is ID of textarea HTML element, that will be turned into WYSIWYG editor.

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