J1.5

Difference between revisions of "Filelist parameter type"

From Joomla! Documentation

(This is a form field, not a parameter.)
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
[[Image:Params.filelist.jpg|right]]
 
[[Image:Params.filelist.jpg|right]]
 +
 +
{{Ambox|type=notice|text=[[Parameter|Parameters]] have been superseded by [[Form field|form fields]] in Joomla! 1.6. You may want to use the corresponding [[Filelist form field type]].}}
 +
 
The '''filelist''' parameter type provides a drop down list of files from a specified directory.  If the parameter has a saved value this is selected when the page is first loaded.  If not, the default value (if any) is selected.
 
The '''filelist''' parameter type provides a drop down list of files from a specified directory.  If the parameter has a saved value this is selected when the page is first loaded.  If not, the default value (if any) is selected.
  
Line 22: Line 25:
 
* [[Folderlist parameter type]]
 
* [[Folderlist parameter type]]
 
* [[Imagelist parameter type]]
 
* [[Imagelist parameter type]]
* [[Standard parameter types|Full list of standard parameter types]]
+
* [[Standard parameter types|List of standard parameter types]]
[[Category:Components]][[Category:Modules]][[Category:Plugins]][[Category:Templates]][[Category:Development]]</noinclude>
+
[[Category:Standard parameter types]]</noinclude>
[[Category:References]][[Category:Template Development]]
 
[[Category:Module Development]]
 
[[Category:Plugin Development]]
 
[[Category:Component Development]]
 

Revision as of 12:38, 20 May 2011

The "J1.5" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Params.filelist.jpg

The filelist parameter type provides a drop down list of files from a specified directory. If the parameter has a saved value this is selected when the page is first loaded. If not, the default value (if any) is selected.

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 filelist.
  • name (mandatory) is the unique name of the parameter.
  • label (mandatory) (translatable) is the descriptive title of the field.
  • directory (optional) is the filesystem path to the directory containing the files to be listed. If omitted the directory given by JPATH_ROOT is assumed.
  • default (optional) is the default 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 files selected for inclusion in the drop-down list. If omitted, all 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 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 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 parameter definition:

<param name="myfile" type="filelist" default="" label="Select a file" description="" directory="administrator" filter="" exclude="" stripext="" />

See also[edit]