I created a file view with some fields (image, name, size, upload date) and configured the "Files that can be referenced" with the view.

But when i create a node, i only have a generic view to reference existing nodes, only with the title and the size of the files.

How can i add the image and the upload date of the file in the reference view?

Image attached.

Comments

antiorario’s picture

I assume you're using FileField Source Reference Options to pull up the view, since FileField Sources doesn't provide the functionality. FileField Source Reference Options displays fields according to FileField Sources (only file name and size), and since FileField Source is Views-agnostic, this doesn't sound like something that will happen any time soon—unless quicksketch decides to integrate the relevant functionality as in #730578: Options for Autocomplete (restrict file list) and provide extra options to customize the file list.

ArielCamino’s picture

Status: Active » Fixed
StatusFileSize
new1.06 KB

Thanks antiorario! Yes i'm using FileField Source Reference Options, and finally i modified the module, and use timestamp and filepath for showing the imageas in the theme_filefield_sources_reference_opt_autocomplete_item function. Patch attached.

antiorario’s picture

Project: FileField Sources » FileField Sources Reference Options [obsolete]
Version: 6.x-1.4 » 6.x-1.0
Component: Source: Auto-complete » Code
Category: support » feature
Status: Fixed » Needs review
antiorario’s picture

Status: Needs review » Closed (won't fix)

Even with your patch, the timestamp and the filepath will not be shown in the drop-down list, because the theme function in FileField Sources does not take the new fields into account. A more generic approach, by which an admin could choose which fields to display (and which could make things very messy) would work best with the cooperation of FileField Sources. Won't fix, for now.

mtcs’s picture

Status: Closed (won't fix) » Needs review
StatusFileSize
new4.67 KB

Sorry for reopening this issue but I needed this functionality and following the original "source" (cck nodereference and patches) I've created a patch to display view fields instead of filename and size.

It works for me but I haven't tested very thoroughly (especially the non-views selection might be broken).

Please, have a look at it and let me know what you think.

antiorario’s picture

Version: 6.x-1.0 » 6.x-1.1
Status: Needs review » Closed (fixed)

It's taken me a while, I know, but I tested #5 and committed. The new release should be out in a few minutes.