Installing the plugin:
Use the typo3 extension manager to install the "jpk_downloadcounter" plugin.
Now create a new page somewhere on your website and disable caching (3) for this page. This page will be called for all links, it will redirect the user to the requested download, so you might name this page "download" (2) or whatever you like.
After installing the plugin you need to add the following lines to your main template (replace 83 with the uid (1) of the newly create uncached donwload base page)
now add the plugin to the static includes of your main template
in "edit whole template record" view scroll down to the "Include static (from extensions):" part and add the "download link with counter (jpk_downloadcounter)" option to the includes list.
thats it, now the plugin should be ready to use.
Creating a new download-link:
in order to create a new download link, you need to follow these simple 3 steps:
- in the backend navigate to the page you want to create a link on and switch to the list view (1). Now Click on create new record (2) and select "linkage information" as the new record to create (3):
- in the new record form select the link target (could be either a file or a url. If you want to link to an external website make sure to provide a fully qualified URL including http : //) enter at least the display name for the new link. The description can be left blank.Click on save to create the new link record.
- to display the new link record on your page there is only one step to do. In the backend navigate to the page you want to display the link on and change to the "Page" view. In the column where to place the link plugin click on the "create new content element" (1) button. In the list of available plugins select the "downloadlink with counter" plugin (2). If you created the linkage information record from the previous step on the same page as you placed the plugin on, you can now simply click on save, if not you need to specify one or more starting points (3) to get the linkage information records from.
you are done, change to the frontend and check if your links are being displayed.
If you want to change the display style of the links you can either do so by adding a css class "downloadLink" (this class is used in the template on the surrounding div for each link element) to your css file and adapt it to your needs or you can change the template file for this plugin which can be found at:
[typo3 installation path] /ext/jpk_downloadcounter/pi1/downloadCounter.tmpl