Problem/Motivation

Currently there is no simple way on adding a download link in a views overview.

Proposed resolution

Add a views field to add a "Download file" link.

Comments

JeroenT created an issue. See original summary.

jeroent’s picture

StatusFileSize
new1.62 KB

The patch attached, adds a views field cfr. the edit/delete/... links.

jeroent’s picture

Status: Active » Needs review
berdir’s picture

Hm, wondering if an entity operation would be equally/more useful, then it would automatically appear in all existing operations fields? What's the use case for a standalone download link?

Problem of that is that we'd want to check if it makes sense for a given type, but currently there's no per-bundle setting for that. Mh...

jeroent’s picture

I added a link cfr. \Drupal\views\Plugin\views\field\EntityLinkEdit.

I had a case where I needed to make the media library available for all users. Which resulted in an overview of all media items with a download link.

panchuk’s picture

JeroenT It's works for me. Thanks!

jonmcl’s picture

Status: Needs review » Reviewed & tested by the community

This should be in the module. We have been successfully using it for month. Correctly constructed.

bgilhome’s picture

StatusFileSize
new1.62 KB
new591 bytes

Works for me. A suggestion is to extend from EntityLink rather than LinkBase to add the options 'Output URL as text' and 'Use absolute URL'. Patch and interdiff attcahed.

bgilhome’s picture

StatusFileSize
new1.67 KB
new586 bytes

Sorry, the 'absolute' option handling needs to be added - attached.

alina.basarabeanu’s picture

StatusFileSize
new46.21 KB

Patch #9 works on drupal/media_entity_download (2.1.0) and drupal/core (9.4.2)

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Makes sense, committed.

  • Berdir committed eeff52c on 8.x-2.x authored by bgilhome
    Issue #3100224 by bgilhome, JeroenT, Alina Basarabeanu: Views...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

alina.basarabeanu’s picture

This issue was included in the 2.2.0 version.