Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Joomla 3 Article Modal form field in custom module

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.

like image 737
sunny Avatar asked Mar 23 '23 07:03

sunny


1 Answers

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="" />
like image 84
mozami Avatar answered Apr 27 '23 04:04

mozami