Joomla imagelist Form Field Type

The imagelist form field type provides a drop down list of image files in a specified directory. Only files with .png, .gif, .jpg, .jpeg, .bmp, .ico, .psd, .eps, .avif, .webp, .heic and .wp2 extensions are listed. The imagelist field extends the filelist filed type.

By default, the first item on the list is '- Do not use -' (which is translatable) and is given the value '-1' and this is followed by '- Use default -' (also translatable) given the value '0'.

XML Field Definition

<field name="myimage"
type="imagelist"
label="Select an image"
directory="images/myimages" />

Additional Parameters

directory: This is the filesystem path to the directory containing the image files to be listed. If omitted the directory given by JPATH_ROOT is assumed.

filter: This is a regular expression string which is used to filter the list of image files selected for inclusion in the drop-down list. If omitted, all image files in the directory are included. The filter argument expression is applied before the exclude argument expression.

exclude: This is a regular expression string which is used to exclude image files from the list. The exclude argument expression is applied after the filter argument expression.

stripext: If true then file name extensions will be stripped from the image file names listed. The file name will be saved without the extension too.

hide_none: If true, the '- Do not use -' item is omitted from the drop-down list.

hide_default: If true, the '- Use default -' item is omitted from the drop-down list.