Using wysiwyg outsied of CMS
3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 23, 2013 (RSS)
By nmsinc - July 20, 2013
I need to add the wysiwyg editor to form outside of the CMS. How is this accomplished?
Thanks - NMSINC
By gregThomas - July 22, 2013
Hi NMSINC,
It is possible to use the WYSIWYG editor outside of the CMS, but it's not easy to implement, and requires the modification of core CMS Builder code. So any issues you ran into we wouldn't be able to provide support for. It might be easier to implement a different WYSIWYG editor into the front of your site, or even implement TinyMCE again separately. Here are some different WYSIWYG editors you could try:
https://github.com/spocke/punymce
If you want to integrate the editor built into CMS Builder you will need do the following:
- You will need to create a copy of wysiwyg.php which you can find in the cmsAdmin/lib directory and move it into the base directory of your site, and modify any include paths to the correct location, you will also have to remove any of the functionality that cannot be used outside of the CMS, for example uploading images.
- You will need to include the tiny_mce.js file from cmsAdmin/3rdparty/tiny_mce/tiny_mce.js in the page you want to have the editor.
- You will need to initiate the editor using the following code:
<script type="text/javascript">
tinyMCE_GZ.init({
plugins: 'inlinepopups,contextmenu,table,fullscreen,paste,media,spellchecker',
themes : 'advanced',
languages : 'en',
disk_cache : true,
debug : false
});
</script>
- You need to create a textarea with an id of wysiwyg that will be used to hold the WYSIWYG editor.
- Below the textarea you need to include the copy of wysiwyg.php file, and initiate the initwysitwy function like this:
<?php
require_once("blogWysiwyg.php");
initWysiwyg('wysiwyg', 'wysiwygUploadBrowser');
?>
If you decide to integrate the CMS Builder WYSIWYG and run into any issues, if you send an e-mail to consulting@interactivetools.com, we can help with the integration process.
Thanks!
Greg
PHP Programmer - interactivetools.com