q4.events
Fetches and displays events from the Q4 API's.Below is an example of a past events widget.
- It uses date and time, which requires the
useMoment
option to be true
and the Moment.js library to be referenced on the page.- Since it is a past events widget,
showFuture
is set to false
.- Events can pull in "related" content from the following API's: Presentations, Press Releases and Financial Reports. Template variables for related content are inherited from their respective widget. For example, one can use press releases
shortBody
variable in the events widget template for related press releases.- Based on the template configuration, the widget will only show related files such as presentations or webcasts if they exist for that event.
- Script link
- q4.api.1.13.6.min.js
- Source file
- q4.api.js, line 1703
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 class="module_options">
<label class="module_options-label" for="eventArchiveYear">Select Year: </label>
<select class="dropdown module_options-select" id="eventArchiveYear"></select>
</div>
<div class="module_container module_container--content"></div>
</div>
<script></script>
Options
- showFuture boolean
-
Whether to fetch events dated in the future.
- Default value
true
- showPast boolean
-
Whether to fetch events dated in the past.
- Default value
true
- template string
-
- 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 event item.{{url}}
- The URL of the event details page.{{id}}
- The event ID, used for constructing calendar links.{{date}}
- The starting date of the event.{{endDate}}
- The ending date of the event.{{timeZone}}
- The timezone of the start/end dates.{{location}}
- The URL of the document's thumbnail image.{{webcast}}
-{{body}}
-{{#isFuture}}
- An alternative to the showFuture widget option. Using this in the template will allow you to define a unique template events in the future, without affecting other events in the array. To use, wrap {{#isFuture}} around other template variables and close with {{/isFuture}}{{#isPast}}
- An alternative to the showPast widget option. Using this in the template will allow you to define a unique template events in the past, without affecting other events in the array. To use, wrap {{#isPast}} around other template variables and close with {{/isPast}}{{#speakers}}
- An array of the event's speakers. Inner variables are:{{name}}
- The speaker's name.{{position}}
- The speaker's position or job title.
{{#tags}}
- An array of tags for this event item.{{.}}
- Tag word.
{{#docs}}
- An array of attached documents. Inner variables for each document are:{{title}}
- The title of the attachment{{url}}
- The URL of the attachment{{type}}
- The type/category of attachment (ex. Document, Presentation, Video, Audio){{extension}}
- The file extension for the attachment{{size}}
- The speaker's position or job title.
{{#financialReports}}
- An array of related financial reports.- See the financial reports widget page for a full list of available template options.
{{#pressReleases}}
- An array of related press releases.- See the news widget page for a full list of available template options.
{{#presentations}}
- An array of related presentations.- See the presentations widget page for a full list of available template options.