I have created Joomla module and added a custom field type at the parameter configuration in the backend, using the .xml file like this:
<fields name="params">
<fieldset
addfieldpath="/modules/<module_name>/fields" name="basic">
<field name="articles" type="articles" label="label" />
.
.
.
</fields>
That is working pretty fine but there is on question left over: How can I access the module's id inside the custom field class, when invoked to create the fields html?
Thanks in ahead!
UPDATE
I digged a bit deeper in that found the JModuleHelper::getModule($type, $name)
method, which returns either the first module of the given $type
if no $name
is specified, or the module of the given $type
having the $name
, but since it is possible to create Modules with the same name, this approach is kind of ugly.