Published: 2017-12-26   Views: 3479
Author: hasanuzzaman
Published in: Dolibarr
Module Development: How To Load Dolibarr WYSIWYG Editor

As a Dolibarr Module Developer Sometime you may need to load WYSIWYG Editor in your module. The full form of WYSIWYG is, what you see is what you get. This editor is very useful for creating or implementing online content editing feature like a CMS. Now loading the editor within Dolibarr environment is not complex. Dolibarr provides a dedicated class for this need. A sample code is given below..................

 

 

// Content
print ''.$langs->trans("Content").'';
// Editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('note',$object->note,'',200,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,'90%');
$doleditor->Create();
print '';

 

The above code will create a WYSIWYG editor. The is a table row. The first column of the row is for title of the editor. The second column is for editor itself. Make sure you have given desired number of rows for editor's height. In this case it is, ROWS_7.

You can control the width of the Editor using the last parameter of the Constructor function.

WYSIWYG editor loading Dolibarr

The above image illustrate the resulted output of the code.

Note: If the all above three steps does not solve your problem you can contact us without any hesitation. We will be happy to assist you.

Article Comments

0 comments.

There are zero comments yet, why not be the first?

You must be logged in to post a comment.

Please log in or register to comment or reply to a comment.

Articles Search

Featured Articles

Most Popular Articles

Article Categories Expand

7  
1  
1  
1  
0  
6  
0  
53  
3  

There are zero sub-categories in this parent category.

49  
4  
6  
3  
3  
7  
4  
8  
3  
2  
1  
0  
0  
0  
26  
0  
0  
0  
1  
2  
8  
1  
1  
0  
1  
1  
0  
1  
1  
0  
0  
1  
4  
0  
3  
3  
0  
1  
25  
1  
0  
0  
1  
0  
0  
6  
0  
1  
29  
1  
0  
2  
0  
11  
0  
0  
0  
0  
3  
2  
0  
2  
2  
1  

There are zero sub-categories in this parent category.

3  
1  
2  
5  
0  
3  
2  
1  
0  
0  
1  
0  
1  
2  
0  
1  
0  
21  
0  

There are zero sub-categories in this parent category.

0  
1  
0  
0  
0  
0  
0  
1  
0  
0  
0  
2  
24  
17  
3  
1  
0  
0  
0  
0  
1  
1  
0  
0  
0  
0  
0  
1  
0  
0  
1  
3  
0  
0  
0  
0  
0  
0  
0  
1  
1  
0