Difference between revisions of "Imagelist form field type"

From Joomla! Documentation

(Created page for form field type)
 
(Marked this version for translation)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
<noinclude><languages /></noinclude>
 +
<translate><!--T:1-->
 +
The '''imagelist''' form field type provides a drop down list of image files in a specified directory. Only files with .png, .gif, .jpg, .bmp, .ico extensions are listed. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.</translate>
 
[[Image:Params.imagelist.jpg|right]]
 
[[Image:Params.imagelist.jpg|right]]
 +
<translate><!--T:2-->
 +
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'.</translate>
  
{{Ambox|type=notice|text=In Joomla! 1.5, [[Form field|form fields]] were [[Parameter|parameters]]. For that version, you may want to use the corresponding [[Imagelist parameter type]].}}
+
<translate><!--T:3-->
 +
* '''type''' (mandatory) must be ''imagelist''.</translate>
 +
<translate><!--T:4-->
 +
* '''name''' (mandatory) is the unique name of the field.</translate>
 +
<translate><!--T:5-->
 +
* '''label''' (mandatory) (translatable) is the descriptive title of the field.</translate>
 +
<translate><!--T:6-->
 +
* '''directory''' (optional) is the filesystem path to the directory containing the image files to be listed. If omitted the directory given by JPATH_ROOT is assumed.</translate>
 +
<translate><!--T:7-->
 +
* '''default''' (optional) is the default image file name.</translate>
 +
<translate><!--T:8-->
 +
* '''description''' (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.</translate>
 +
<translate><!--T:9-->
 +
* '''filter''' (optional) 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. For information on constructing regular expressions see [[S:MyLanguage/Regular expressions in parameter arguments|Regular expressions in parameter arguments]].</translate>
 +
<translate><!--T:10-->
 +
* '''exclude''' (optional) 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. For information on constructing regular expressions see [[S:MyLanguage/Regular expressions in parameter arguments|Regular expressions in parameter arguments]].</translate>
 +
<translate><!--T:11-->
 +
* '''stripext''' (optional) is a Boolean argument. If true then file name extensions will be stripped from the image file names listed. Also note that the file name will be saved without the extension too.</translate>
 +
<translate><!--T:12-->
 +
* '''hide_none''' (optional) is a Boolean argument. If true, the '- Do not use -' item is omitted from the drop-down list.</translate>
 +
<translate><!--T:13-->
 +
* '''hide_default''' (optional) is a Boolean argument. If true, the '- Use default -' item is omitted from the drop-down list.</translate>
  
The '''imagelist''' form field type provides a drop down list of image files in a specified directory. Only files with .png, .gif, .jpg, .bmp, .ico extensions are listed. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.
+
<translate><!--T:14-->
 +
Example XML field definition:</translate>
 +
<source lang="xml"><field name="myimage" type="imagelist" default="" label="Select an image" description="" directory="" exclude="" stripext="" /></source>
  
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'.
+
<translate>=== See also === <!--T:15--></translate>
 +
<translate><!--T:16-->
 +
* [[S:MyLanguage/Standard form field types|List of standard form field types]]</translate>
  
* '''type''' (mandatory) must be ''imagelist''.
 
* '''name''' (mandatory) is the unique name of the field.
 
* '''label''' (mandatory) (translatable) is the descriptive title of the field.
 
* '''directory''' (optional) is the filesystem path to the directory containing the image files to be listed. If omitted the directory given by JPATH_ROOT is assumed.
 
* '''default''' (optional) is the default image file name.
 
* '''description''' (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
 
* '''filter''' (optional) 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. For information on constructing regular expressions see [[Regular expressions in parameter arguments]].
 
* '''exclude''' (optional) 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. For information on constructing regular expressions see [[Regular expressions in parameter arguments]].
 
* '''stripext''' (optional) is a Boolean argument. If true then file name extensions will be stripped from the image file names listed. Also note that the file name will be saved without the extension too.
 
* '''hide_none''' (optional) is a Boolean argument. If true, the '- Do not use -' item is omitted from the drop-down list.
 
* '''hide_default''' (optional) is a Boolean argument. If true, the '- Use default -' item is omitted from the drop-down list.
 
 
Example XML field definition:
 
<source lang="xml"><field name="myimage" type="imagelist" default="" label="Select an image" description="" directory="" exclude="" stripext="" /></source>
 
 
<noinclude>
 
<noinclude>
=== See also ===
+
<translate>
* [[Standard form field types|List of standard form field types]]
+
<!--T:17-->
[[Category:Standard form field types]]</noinclude>
+
[[Category:Standard form field types]]
 +
</translate>
 +
</noinclude>

Latest revision as of 14:18, 19 August 2015

Other languages:
English • ‎Nederlands • ‎español • ‎français

The imagelist form field type provides a drop down list of image files in a specified directory. Only files with .png, .gif, .jpg, .bmp, .ico extensions are listed. If the field has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

Params.imagelist.jpg

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'.

  • type (mandatory) must be imagelist.
  • name (mandatory) is the unique name of the field.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • directory (optional) is the filesystem path to the directory containing the image files to be listed. If omitted the directory given by JPATH_ROOT is assumed.
  • default (optional) is the default image file name.
  • description (optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.
  • filter (optional) 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. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • exclude (optional) 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. For information on constructing regular expressions see Regular expressions in parameter arguments.
  • stripext (optional) is a Boolean argument. If true then file name extensions will be stripped from the image file names listed. Also note that the file name will be saved without the extension too.
  • hide_none (optional) is a Boolean argument. If true, the '- Do not use -' item is omitted from the drop-down list.
  • hide_default (optional) is a Boolean argument. If true, the '- Use default -' item is omitted from the drop-down list.

Example XML field definition:

<field name="myimage" type="imagelist" default="" label="Select an image" description="" directory="" exclude="" stripext="" />

See also[edit]