2

I'm creating a module, where the user posts a HTML code on the backend and it will be rendered on the site page.

However, when I save the module content, the HTML disappear and just plain text is shown, and the HTML is ignored.

Before Saving:

before saving

After Saving:

After saving

I'm creating the field like this, in my component .xml file

<fields name="params">
    <fieldset name="basic">         
        <field name="html_code" type="textarea" rows="10" cols="30" />
    </fieldset>
</fields>

1 Answer 1

2

Try adding filter="raw" to your XML file:

<fields name="params">
    <fieldset name="basic">         
        <field name="html_code" type="textarea" rows="10" cols="30" filter="raw" />
    </fieldset>
</fields>

filter (optional) allow the system to save certain html tags or raw data.

(from https://docs.joomla.org/Text_form_field_type)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.