Skip to content

FlowCommunications/force-download

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ForceDownload plugin for Craft CMS 3.1

Simple Downloader for Craft CMS 3.1.

Requirements

This plugin requires Craft CMS 3.1.0 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require mdxdave/force-download
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for ForceDownload.

Using ForceDownload

Just use the following code in your Twig template file (whereas filename is an asset field):

    {{ entry.filename[0]|forceDownload }}

To use a rudimental download counter, use the fieldname as 2nd param (the downloadCounter field will be inceremented by 1):

    {{ entry.filename[0]|forceDownload("downloadCounter") }}

Brought to you by MDXDave

About

ForceDownload plugin for Craft CMS 3.0

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%