I have created a download list, based on the file list
component. I have a requirement to provide functionality that allows the content editor to determine whether, on click, a file should be downloaded, opened in a new tab or opened in the current tab.
I started by creating a droplist
field on the template on which I set the source
to an options folder I'd created containing the above choices.
From here, I intended to set rules on the file to determine how it should behave based on what was selected in the droplist
but I realised that this functionality wasn't available in the rules engine.
Here's a picture of my variant, if it's useful:
How can I achieve this?
download
attribute on a tags? w3schools.com/tags/att_a_download.aspContent-Disposition
header to force a download: jammykam.wordpress.com/2015/11/16/force-download-of-media-files. You could follow a similar solution for opening in a new tab by using a specific CSS class and Javascript.