ERP5 Formulator has been designed to display simple types such as strings, numbers, dates, etc. It was never designed to display HTML content.

ERP5 extends formulator with new fields which can display images (ImageField), lists of documents (ListBox), matrices (MatrixBox) and HTML (EditorField).

HTML: always use EditorField

The only way to embed HTML in an ERP5 form is to use an EditorField. Some people have tried to use LabelField and other fields for that: it is wrong. Use EditorField instead.

Editor Field has two modes: editable and non editable. It can use for now 2 different editors: TextArea (useful for browsers such as Safari) and FCKEditor (useful for Firefox for example). More editors might be supported in the future. Community is welcome to contribute.

In editable mode, EditorField displays an editor to change HTML source code. In non editable mode, the HTML content is stripped and displayed as is into the Web Page.

Note: EditorField is not yet well integrated with ODF styles of ERP5.

Text Content: EditorField or TextArea ?

Some people prefer to use plain text documents or structured text to define styled documents which would normally be defined using HTML. EditorField can also be used in such a case, a eventually extended (look for example how moin moin Wiki does with FCKEditor).

However, not all styled text documents are supported by EditorField with FCKEditor. This is why EditorField must be able to switch to TextArea mode each time a document format is not supported with FCKEditor. In such a case EditorField looks like a TextAreaField.

Although EditorField looks like a TextAreaField in editable mode, it is capable unlike TextAreaField of producing embeddable HTML in non editable mode. This feature is useful each one wants to display style text content which can be rendered in HTML.

In conclusion, use TextAreaField if you need to display text content in read only mode as it was entered in editable mode. Use EditorField if you need to display style text in read only mode.

HowToDisplayOrEditHTML (last edited 2009-09-11 14:26:41 by jp)