Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.This could be useful
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | add_file_link_support_v2.patch | 1.57 KB | stefan lehmann |
| #2 | add_file_link_support.patch | 1.29 KB | stefan lehmann |
Comments
Comment #1
pere orgaCould also provide alternatives to this: https://drupal.org/project/file_formatters
Comment #2
stefan lehmannI just did this for one of our projects. Would be cool if it could go into the production version, so I can remove the module from the "patched" folder. Thank you!
PS: This patch is for version 1.3!
Comment #3
leon kessler commentedThanks, this looks good, except one thing...
This should probably come from somewhere the user has control over. E.g. if using the media browser widget you can add a description to the file (which gets stored in
$field[0]['description']). There is also a title property on a file field, although I cannot workout how to submit data to it (but it could be that other modules are using it, so I don't see a harm in supporting it).Comment #4
stefan lehmannYeah, good idea. Just one thing .. As far as I know the description field is optional. so it should probably fall back to the file name, if no description is given.
Surfing via phone. Will have a look next Monday, if you want to have a full patch. :-)
Comment #5
leon kessler commentedYep sounds good,
I think it should probably look in
$field[0]['title'], then$field[0]['description']and then$field[0]['filename']Comment #6
stefan lehmannUpdated the patch.
I tested it with a filled out description and without. And yeah .. also no clue how to fill that title field, but it should (fingers crossed) work, if so.
Comment #7
stefan lehmannComment #10
leon kessler commentedAwesome! Committed to dev.
I also added file field to the list of supported fields in the README.txt documentation.