5

Joomla includes many built-in filds that can be used in the XML manifest file (Available fields in Joomla XML manifest), but is it possible to use them to build forms for the visitors, in a module or maybe in an article?

For instance, can I add a color picker to a front-end form?

<field name="backgroundcolor" type="color" default="#eee" label="Color selector field" description="TPL_BEEZ3_FIELD_HEADER_BACKGROUND_COLOR_DESC" />

(this is from the xml file, but I would like to implement something similar in an article)

4

Yes, with Joomla's JForm, you can use them virtually anywhere - here's a tutorial that might help, and an example to Custom field in a content plugin:

<?xml version="1.0" encoding="UTF-8"?>
<form>
    <fields name="params" >
         <fieldset name="params" >
            <field
               name="content_myfield"
                type="text"
                label="PLG_CONTENT_GDP_MYFIELD"
                />
        </fieldset>
    </fields>
</form>

The full example for this code is at How to save Custom Fields in Core components.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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