1

I´m using for the first time Guest Entries plugin to collect some info and some files from users, great! All it´s going great, the site admin will see all the info that the clients sends and the files from each one, but i would like to know if there is a way to download the assets from a specific entry, so keep it simple to download the assets sended by some specific user.

enter image description here

Something like this plugin does, but it doesn´t work. https://github.com/Hambrook/AssetLinks

I found this one too, but it downloads the assets of a entire source. https://github.com/mattstauffer/craftcms-DownloadAssets

Any help? Thanks!

1

Change the javascript of the asset file to something like this and it will work

$(function(){
    $(".field .input .elementselect .element:not(.linked)").each(function(){
        var $this = $(this);
        if (!$this.data("url")) { return false; }
        var $a = $("<a class='icon'> </a>")
            .attr("href", $this.data("url"))
            .attr("title", "Download")
            .addClass("download")
            .addClass("sharebtn")
            .addClass("icon")
            .attr('download', $this.data('label'))
            .appendTo($this);
        $this
            .addClass("linked")
            .prepend($a);
    })
});
| improve this answer | |
  • Amazing! Thank you! – Sebastian Mar 6 '18 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.