q4.downloads
This widget fetches and displays downloads (also known as "Content Assets") from the Q4 API's.Below is an example of a download list widget.
- It uses the
template
option as there is no need for a year/item separation or filter in this example.- Since it is a past events widget,
showFuture
is set to false
.- The template will loop through each year, and each item inside that year and render the values of the variabels within.
- Script link
- q4.api.1.13.6.min.js
- Source file
- q4.api.js, line 1627
This widget extends the q4.api widget. It has all the options and methods of the parent widget, in addition to those below. See the parent widget's documentation for details.
Examples
<div class="module_container module_container--widget"></div>
<script></script>
Options
- template string
-
A Mustache.js template for the download list widget.
- All the notes documented in the q4.api parent widget are applicable here.
- This widget supports
template
,itemTemplate
andyearTemplate
options.
template
oritemTemplate
may contain the following mustache variables:{{title}}
- The title of the download item.{{description}}
- The download description.{{url}}
- The URL of the document.{{date}}
- The date of the download.{{type}}
- The download list category (ex. Governance Documents, Factsheets).{{fileType}}
- The file type.{{size}}
- The file size.{{icon}}
- The URL of the document's icon.{{thumb}}
- The URL of the document's thumbnail image.{{#tags}}
- An array of tags for this download item.{{.}}
- Tag word
- downloadType string
-
The download list category to pull from. This option is unique to the download list widget.
- Default value
null
- Example
"Governance Documents"