Posted by infojunkie on March 8, 2010 at 3:40am
3 followers
| Project: | FileField |
| Version: | 6.x-3.2 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I have a File view, i.e. a view of type "File" whose base table is {files}. I would like to list only files that are present in a specific filefield. Typically, this would be done via a FileField relationship in the view, that joins the file table to the node table (via the various CCK tables). Is that currently possible?
The Upload: Node relationship, for example, implements this join between files and the nodes where they were uploaded via the Upload module.
Comments
#1
Attached is a patch to achieve what I need. In
filefield_field_settings_views_data, I add the necessary declarations to find a "Content: Node" relationship that, when marked as required, shows only files that are attached to a certain filefield, and exposes the associated node data.#2
Hm, interesting... I think this makes sense to include, but you could actually already accomplish the same thing if you started with a view of type "Node", then made a relationship over to the Files table. This patch just makes it so that you can do it both directions.
#3
You're right, but in my case, I cannot start with a "Node" table, for other reasons.
#4
Attached is a slightly modified version where the new relationship is named after the field's label, instead of the generic "Node" label. This works better when multiple filefields exist.
#5
Patch works great. Thanks for your contribution infojunkie! Committed and will be in the 3.3 version.
#6
#7
Automatically closed -- issue fixed for 2 weeks with no activity.