Question

I want to have an article picker in my custom module. A button and a form field like this one in add new article.

Is ist possible? I tried this in my module xml:

                <field name="article_id" type="modal_article" default="" label="Select an article" description="" />        

But I only get a form input, not a button to choose an article.

Was it helpful?

Solution

You need to manually add the path to the modal article element. In the < fieldset > element just above the modal_article field type, add the following attribute:

 addfieldpath="/administrator/components/com_content/models/fields"

So your final xml would look something like this:

<fieldset name="basic" addfieldpath="/administrator/components/com_content/models/fields">
<field name="article_id" type="modal_article" default="" label="Select an article" description="" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top