I have created a Joomla module that renders a set of headlines in a widget, with links to the main item. It loads these headlines from either a Joomla category or an RSS feed, and is extensible so I could add further data sources.
In the config XML, I've got a select
field to pick the data source, and subsequent fields that use showon
to enable one or more of them depending on which source is picked. This works well.
Now I want to move the code for the data sources into separate plugins, to make it more easily extensible. But I'm running into a stumbling block over how to show fields from these plugins in the module config.
I can see how to create a plugin
field in the module which will allow me to offer a list of the relevant plugins, but I also need to be able to pull in config fields from the selected plugin.
I know I could just have the config for the plugins in the plugins themselves, but I would prefer to have it at the module level because you might want more than one widget on your site with different config but using the same plugin.
I'm currently looking at either creating a custom field type, as per this question on SO or to use a subform
.
However, as far as I can see, this only allows me to create a single field; what I need is to create an arbitrary number of fields, and also to link them back to the plugin list field so they can be shown or hidden as appropriate.
Can anyone give me some advice on how to achieve this?
Thank you!