I am developing a cusom component and I would like it to support rich text fields. Possibly the same way it is done in com_content
.
in the form definition I have the following field:
<field
name="description"
type="editor"
label="COM_MYCOMPONENT_DESCRIPTION_LABEL"
description="COM_MYCOMPONENT_DESCRIPTION_DESC"
class="inputbox"
filter="MyComponentHelper::filterText"
buttons="true"
/>
So basically what happens is that the editor appears as it is supposed to but the text is saved without formatting.
The MyComponentHelper::filterText
method was added later after investigating com_content
and copying the filterText
method to my helper, but it did not work either with or without the line. I even tried to use ContentHelper::filterText
but without success.
OK, so this was my bad. As I have followed the tutorial
MyComponenetHelper
ended up as an abstract class. I made it a normal class and everything works fine.