Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Work in progress...
Comment | File | Size | Author |
---|---|---|---|
#5 | Screen shot 2011-05-05 at 3.50.56 PM.png | 201.26 KB | osman |
Work in progress...
Comment | File | Size | Author |
---|---|---|---|
#5 | Screen shot 2011-05-05 at 3.50.56 PM.png | 201.26 KB | osman |
Comments
Comment #1
greg.harveyAwesome, let me know if we can help!
Comment #2
nicholasThompsonMarking as fixed as the dev branch now has this feature. Please re-open if it needs more work, or open another ticket if there are issues with it....
Comment #4
osmanHi there,
I am having an issue with Views. Generated stats URL has vid missing. Thus, the links returns "Page not found" errors.
The CCK file field is set to "Generic files + Stats URL" in content-type Display settings and also in the view I attached below.
Apparently the stats URLs forget the node vid when they are generated only in the views. Any suggestions or fixes are very much welcome.
Thanks,
osman
Formatted file link rendered on the view page:
http://www.example.com/_/filefield_stats/73//3/0d12714bb4d03622ecbcf8383...
Formatted file link rendered on the node page:
http:/www.example.com/_/filefield_stats/73/82/3/8485a696367d8ea490646204fe8284cb
The copy of the VIEW:
Drupal 6.20
Filefield Stats 6.x-1.x-dev (2011-Apr-18)
Comment #5
osmanSeems like
$node = $element['#node'];
can only get its value, when the file is displayed on nodes.theme_filefield_stats_formatter()
function returns NULL for$node
when it is used in the views, even though the formatter is available in the Views (See screenshot).I am not sure how to make
$node
object available in this formatter. It is a great module and I thank for it.Any ideas how to make it Views friendly?
Thanks,
Comment #6
osmanSolution:
The view should have been based on File type, not Node.
Once the view type is set to File; and relationships to Content:
File
; both node and file fields become available in Fields options.For testing purposes, I added
$element
's output to theme_filefield_stats_formatter function.Here are the results:
Node view:
File view:
Both views are listing the same file field from the same content-type. Notice the missing data from the
$node
object on the first one?Cheers,
Osman
Comment #7
kbk CreditAttribution: kbk commentedThanks for the documentation, Osman. Here's a bit more that incorporates NID arguments and multiple relationships into the view.
I have two content types with a node reference between them: [Data Set]->[Data File]. I'm also using the Node Referrer module to reverse the node reference direction. This is D6. Here are the fields of interest:
[Data Set]
Associated Data File : [field_dataset_datafile_ref] - Node Reference Type
[Data File]
Public Data File: [field_datafile_public] - FileField Type
Associated Data Set: [field_dataset_referrer] - Node Referrer Type
I want to display referenced [Data Files] on the [Data Set] node via a View that takes the NID of the [Data Set] as an argument and uses relationships to pull in a list of files from the [Data Files] nodes. I will embed this View into a Panels Node Template. Originally, I used a Node type view, but the download link fails because of previously mentioned problems.
Here's my setup:
View Type: File
Relationship 1: "Content: Public Data File Field" > Label: Public Data File
Relationship 2: "Node: Referrer" > Relationship: Public Data File > Label: Referencing Public Data Nodes > Using field: [field_dataset_datafile_ref]
Argument: "Node: Nid" > Relationship: Referencing Public Data Nodes
Fields
Content: Public Data File (field_datafile_public) > Relationship: Public Data File
Here's an example of a Data Set node displaying the file from a Data File node: http://umbs.lsa.umich.edu/research/node/8021
Comment #8
kbk CreditAttribution: kbk commentedTurns out the view I constructed in #7 doesn't solve the Page Not Found error. Any suggestions welcome. This is a bit frustrating.
Edit: More testing reveals that this isn't a Views problem for me. I get a Page Not Found error when hitting the "Generic Files + Stats URL link on the default node page for my content type.
Comment #9
kbk CreditAttribution: kbk commentedthere's no patch for review.