Here I am going to explain how to turn a normal text area into a WYSIWYG(What You See Is What You Get) area in Openerp.Before that let me explain what is WYSIWYG.This may be familiar to web developers, any how WYSIWYG is used in computing to describe a system in which content (text and graphics) displayed onscreen during editing appears in a form closely corresponding to its appearance when printed or displayed as a finished product, which might be a printed document, web page, or slide presentation.
To get a WYSIWYG editor in Openerp, you need to install ‘web_wysiwyg’,
Next step is to create a text field. When you are writing the view for that field, mention widget=”text_WYSIWYG”.
eg: <field name=”description” widget=”text_WYSIWYG”/>
Then write the following code just before the text field in view for a button to enable or disable the WYSIWYG area.
<html>
<a onclick=”javascript:toggle_ckeditor();” class=”wysiwyg_button wysiwyg_button_off oe_button”>WYSIWYG on</a>
</html>
Here I created a WYSIWYG text field and added some html codes(openerp webpage source code) in that field, when I keep the button ‘OFF’, It shows the codes as shown below.
If I keep the button ‘ON’, It shows the html content of web page as shown below.
Anonymous: I got the solution. web_ckeditor4 module is working in openerp 7 for wysiwyng editor.".
Leave a Reply