I am creating a custom module and I want the user to be able to select multiple articles.
So what I did was to set a subform field and then load the xml which contains the modal article picker.
Code: Select all
<field name= "articles"
description= "Select Articles"
type= "subform"
label= "Select Articles"
required= "true"
formsource= "modules/mod_articleblocks/models/forms/articles.xml"
multiple= "true"
buttons= "add,remove,move"
layout="joomla.form.field.subform.repeatable-table"
groupByFieldset="false"/>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<form>
<fieldset addfieldpath="/administrator/components/com_content/models/fields">
<field
name="article_id"
type="modal_article"
default=""
label=""
description="" />
</fieldset>
</form>
Code: Select all
<fieldset name="Articles" addfieldpath="/administrator/components/com_content/models/fields">
<field name= "articles"
description= "Select Articles"
type= "subform"
label= "Select Articles"
required= "true"
formsource= "modules/mod_articleblocks/models/forms/articles.xml"
multiple= "true"
buttons= "add,remove,move"
layout="joomla.form.field.subform.repeatable-table"
groupByFieldset="false"/>
</fieldset>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<form>
<field
name="article_id"
type="modal_article"
default=""
label=""
description="" />
</form>