fields
|
-- fieldName.php
language
|
-- en-GB
|
-- en-GB.plg_fields_fieldName.ini
-- en-GB.plg_fields_fieldName.sys.ini
media
|
-- css
|
-- fieldName.css
-- js
|
-- fieldName.js
params
|
-- fieldName.xml
tmpl
|
-- fieldName.php
fieldName.php
fieldName.xml
fields/fieldName.php
is a custom JForm field. You can add as many custom JForm fields to this directory as you need.language/
contains the language definition files are located.media/
is an optional directory for supporting media like CSS and JavaScript files.params/
contains the form field definitions used when creating a custom field instance in the component configuration.tmpl/fieldName.php
is the frontend template used for rendering the field.fieldName.php
is the plugin entry point.fieldName.xml
is the plugin manifest file used for installation.
-
Custom fields overview at https://docs.joomla.org/J3.x:Adding_custom_fields
The custom field plugin uses the JForm API so the standard Joomla field types as used in an extension's .xml file, are applicable, just written differently, in a .php file.
- You can also add your own JForm fields, see https://docs.joomla.org/Creating_a_custom_form_field_type. A good example of this can be downloaded at https://geodata.solutions/tools/plg_fields_locationlists.zip or check out https://github.com/Digital-Peak/DPFields
For a file form field, you need a destination to upload to. Some options:
- Develop a simple ajax plugin to acept the upload.
- Add an admin template override add
enctype="multipart/form-data"
to the form tag. This has the side effect of that field not being available in thejcfields #item
object.