This module is an extension of FileField Sources. It adds a file source based on existing files but uses a view to filter the list of existing files that may be referenced.

On the field settings form, you may specify the view and display to use.

Eligible views have 'file_managed' as the base table (indicated as 'File' type in the views listing page). The minimal view requirements are a file ID (or fid) field and a filename filter. This module will check the view for a fid field and add it if not found. It will also add its own filename filter so as not to interfere with other filename filters in the view. The view may include other filters (including one based on the filename) based on the applicable context. The fields defined on the view will be rendered inline for the AJAX autocomplete output (in the same fashion as the output from the entity reference module when using the reference view option).

Similar Drupal 6 module

The FileField Sources Reference Options is a very similar module written for Drupal 6. It adds the functionality described in #730578: Options for Autocomplete (restrict file list). It modifies the "Autocomplete Reference" option provided by FileField Sources, adding the ability to restrict the files retrieved by the autocomplete field using a view.

In contrast this module:

  • provides a separate file source option
  • allows you to specify both the view and the display to use for the autocomplete response

Project information

Releases