{kun´ēzē}
10Sep2021

mrwDownload

Information
2478 hits Updated: 19 February 2024 Products: Downloads & Documentation

This module displays a button feature to allow people to download a file—e.g. a ZIP file or a PDF, image or video—and hide the location where the file is stored.  It is useful in cases where people may want to restrict access to downloadable files to registered, logged-in users.

The module also displays a count of the number of times the module has been viewed together with details of the last n visits.  Details include image of the country's flag from where the visitor came how long ago (in days) the visit happened.  This can be useful if you want to know “who” is looking at the module (although it also detects visits from bots) and when they were viewing it.  The information is stored in a database tablethe table name is _mrwdownload which you can extract from the database and import into a spreadsheet application for futher analysis.  Each visit records (a) the IP address, the user ID, if the user has logged-in, and (c) the timestamp when the record was created.  The number of records to be displayed can be configured in the module settings but will default to 5.

Plugin settings

mrwdSettings1

Details of each setting are described below.

ParameterValue
Use as simple hit counter ( Yes | No ) If Use as simple hit counter = Yes the other module settings are not used and the module simply displays a count of the number of times the module has been seen.  If Use as simple hit counterNo (which is the default) the module uses the settings described below and displays a download button as well as a count of the number of times the module has been viewed.
Version [Optional] Enter the version in the recommended format (e.g. x.y.x).  See examples in the next section to understand how this setting is used.  This information is displayed in the module as both an indicator of the specific version of the file as well as in building the name of the file that will be downloaded.  If the file does not have a “version” this field may be left empty; in that case no version information will be displayed.
Compatible with [Optional/Informational] ( Joomla 3 | Joomla 4 | Joomla 5 ) Mainly used if the file is a Joomla extension. Multiple selections allowed (select none, one or both).  Displays the words “Compatible with” together with a image depending on the entered value:  or or
Allowed groups [Optional] Select the user groups who are allowed to view and click the Download button.  Multiple groups may be selected.  If the user belongs to one of the selected groups, the download button will be active otherwise it will be “greyed-out” (inactive).  If you wish to allow anyone to download your file leave this field empty.
Folder path [Required] Enter the path where the file is stored:  absolute or relative folder paths may be used.  If the file is not stored on your website, enter the folder path including the protocol://domain/path.  If the folder path is relative to the same domain where you use the module, set the value as /path.See articles about Absolute URL, Relative URL for more information.
Filename stem [Required] If you have entered a value for Version setting (above), this is the name of the file less the “version” details.  If you have not entered a value for the Version setting, this is the filename (without the Extension type).  The value is case-sensitive and must match the name of the file that will be downloaded.  See examples in the next section to understand how this is used.
Extension type [Required] Enter the filename extension type:  for example zip, pdf, png, etc.  The value can be entered in upper or lowercase; the leading dot is not required and the value will be converted to lowercase.  See examples in the next section to understand how this is used.
Number of view details ( 1 | 3 | 5 | 7 | 9 | 11 | 13 | 15 ) Enter a number of view records to display.  The default is 5.

Usage

Example 1

In this example we want to create a link to the resource located at https://manuals.com/products/user-guides/Acme-Automatic-Cleaner_AAC101.pdf.  The module settings in this case would be:

  • Version = AAC101
  • Compatible with (does not apply)
  • Folder Path = https://manuals.com/products/user-guides
  • Filename stem = Acme-Automatic-Cleaner_
  • Extension type = pdf

Example 2

We have a Joomla 3 extension at /products/cleaner/mod_cleaner-v4.2.1.zip.  The module settings in this case would be:

  • Version = 4.2.1
  • Compatible withJoomla 3
  • Folder Path = /products/cleaner
  • Filename stem = mod_cleaner
  • Extension type = zip

Example 3

  • Version = 4.2.1
  • Compatible with = Joomla 3 and Joomla 4
  • Allowed groups = Registered
  • Folder Path = /products/cleaner
  • Filename stem = mod_cleaner
  • Extension type = zip

Example 4

Let‘s say we have a video at https://acmecleaners.com/products/demonstration/Automatic-Cleaner-demonstration.mpg.  The module settings in this case would be:

  • Version = (does not apply)
  • Compatible with = (does not apply)
  • Folder Pathhttps://acmecleaners.com/products
  • Filename stemAutomatic-Cleaner-demonstration
  • Extension type = mpg

Tips

  • Use the Module Title to describe the item being downloaded; e.g. using the first example above, the title could be “Acme Automatic Cleaner User Manual”.
  • The module can be placed in any template position.  It may be a good idea to place the module in a “sidebar” position on the left or right of the content.  It is a good idea to keep the width of the module position to around 200px.  You can place more than one instance of the module on the same page but only the first module appearing on the page will hide or show the display of visitor records; in any case, while the record counts may be different, the visitors to that page will be the same.
  • The module can be placed on more than one site page; the module can also be placed with other modules.  It may be a good idea to avoid placing the module on too many places but that‘s purely a matter of personal choice.
  • If you restrict the download link to logged-in users, it‘s probably a good idea to display a login module or menu item on the same page.
Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive