Display Events Using Shortcode
In Aurora (WordPress), shortcodes are small bits of code, indicated by brackets, that allow site administrators to execute functions or behaviors without actually writing code.
In Aurora, there are three ways that you can edit a page or post – Visual Editor, Text Editor, or Page Builder.
When using the Visual or Text editor, you can directly type or paste your Events Calendar shortcode into the available space.
When using the Page Builder, we recommend adding a Visual Editor widget. The shortcode can then be added via the Visual or Text view.
The most basic implementation of the events calendar list view shortcode is [uc-events].
Adding this shortcode to your website will feed the next 4 events from the UConn Events Calendar, regardless of which calendar they appear on.
The most basic implementation of the events calendar grid view shortcode is [uc-calendar-grid].
This will display the next 4 events from the events calendar, regardless of which calendar they appear on, as well as a “View More” button. Clicking on the “View More” button will continue to display more events from the ‘All Events’ calendar, in increments of 4 until 100 events are displayed.
Additional attributes can be added to either shortcode to further customize and filter the events that are displayed.
The shortcodes behave in the same way as the widget and blocks when it comes to filtering events, modifying the view, and determining behavior in the case of no events/insufficient number of events.
The UConn Events Calendar Plugin allows users to filter by:
Attribute | Attribute Type | Default Value | Shortcode Example | Helpful Resources |
|---|
Attribute | Attribute Type | Default Value | Shortcode Example | Helpful Resources |
|---|---|---|---|---|
calendar | string | All Events | [uc-events calendar="The Benton | School of Fine Arts"] [uc-calendar-grid calendar="The Benton | School of Fine Arts"] | |
event-type | string | By default, this filter is not applied. | [uc-events event-type="Art & Performance"] [uc-calendar-grid event-type="Art & Performance"] | |
audience | string | By default, this filter is not applied. | [uc-events audience="Prospective Students"] [uc-calendar-grid audience="Prospective Students"] | |
campus | string | By default, this filter is not applied. | [uc-events campus="Storrs"] [uc-calendar-grid campus="Storrs"] | |
tag | string | By default, this filter is not applied. | [uc-events tag="Research"] [uc-calendar-grid tag="Research"] | A full list of the Tags will be available soon. |
Each filter type has its own unique set of values. To check the most current values for each filter, visit events.uconn.edu and view the corresponding fields in the Find Events section.
When entering in values for these attributes, you must input the values exactly as they appear in the dropdowns or Tags list, including punctuation and spaces.
Each filter can accept multiple values. They must be separated by a pipe symbol |
Example
[uc-events calendar="Center for Career Development" event-type="Online Events | Conferences & Speakers | Career & Professional Development"]
[uc-calendar-grid calendar="Center for Career Development" event-type="Online Events | Conferences & Speakers | Career & Professional Development"]
If you have entered-in multiple tags, by default, the system will return items that are tagged with ALL of the listed tags (an AND relationship). By setting this attribute to true, the system will force an OR relationship, meaning that it will return events that include ANY of the listed tags.
Attribute | Attribute Type | Default Value | Shortcode Example |
tag-mode | boolean | false | [uc-events tag-mode="true"] [uc-calendar-grid tag-mode="true"] |
Attribute | Attribute Type | Default Value | Shortcode Example | Available in List View? | Available in Grid View? |
|---|
Attribute | Attribute Type | Default Value | Shortcode Example | Available in List View? | Available in Grid View? |
|---|---|---|---|---|---|
max-number-of-events | integer | 4 | [uc-events max-number-of-events="8"] |
|
|
hide-location | boolean | false | [uc-events hide-location=true] |
|
|
hide-time | boolean | false | [uc-events hide-time=true] |
|
|
hide-summary | boolean | false | [uc-events hide-summary=true] |
|
|
start-date | string | today | [uc-events start-date="next month"]
[uc-calendar-grid start-date="next month"] |
|
|
end-date | string | 6 months | [uc-events end-date="12 months"]
[uc-calendar-grid end-date="12 months"] |
|
|
view-more-btn-text | string | View More Events | [uc-calendar-grid view-more-btn-text="See More"] |
|
|
safe-fallback | boolean | false | [uc-events safe-fallback=true] [uc-calendar-grid safe-fallback=true] |
|
|
fallback-calendar | string | All Events | [uc-events safe-fallback=true fallback-calendar="Athletics"] [uc-calendar-grid safe-fallback=true fallback-calendar="Athletics"] To use this attribute, you must also set safe-fallback to true. |
|
|
no-events-message | string | “There are no upcoming events available at this time. Please visit the UConn Events Calendar to see what else is happening at UConn." *This links out to https://events.uconn.edu | [uc-events no-events-message="We are sorry, but there are no relevant events available"] [uc-calendar-grid no-events-message="We are sorry, but there are no relevant events available."] |
|
|
The same rules/behaviors apply to these attributes as outlined in the Block section.
Shortcode | Description |
|---|
Shortcode | Description |
|---|---|
[uc-events calendar="The Benton | Connecticut Repertory Theatre"] [uc-calendar-grid calendar="The Benton | Connecticut Repertory Theatre"] | Shows events from the Benton calendar and events from the CRT calendar (or, in other words, events that appear on either the Benton calendar OR the CRT calendar). |
[uc-events event-type="Conferences & Speakers | Student Activities"] [uc-calendar-grid event-type="Conferences & Speakers | Student Activities"] | Shows all events that are categorized with event type “Conferences & Speakers” or “Student Activities.” |
[uc-events calendar="Center for Career Development" event-type="Online Events | Conferences & Speakers | Career & Professional Development"]
[uc-calendar-grid calendar="Center for Career Development" event-type="Online Events | Conferences & Speakers | Career & Professional Development"] | Shows online events from the Center for Career Development calendar that are marked with event type “Conferences & Speakers” or event type “Career & Professional Development.” In other words, it will show only online events categorized as “Conferences & Speakers” OR online events categorized as “Career & Professional Development” within the Center for Career Development calendar. |
[uc-events calendar="Center for Career Development" event-type="Student Activities | Training & Workshops" audience="Graduate Students | Undergraduate Students"]
[uc-calendar-grid calendar="Center for Career Development" event-type="Student Activities | Training & Workshops" audience="Graduate Students | Undergraduate Students"] | Shows events on the Center for Career Development calendar that fall into any of the following categories:
|
[uc-events calendar="The Benton" safe-fallback="true" max-number-of-events="12"]
[uc-calendar-grid calendar="The Benton" safe-fallback="true"] | In this example (list view), the code will show up to 12 events from the Benton’s calendar. If the Benton’s calendar does not have any events available, then events will be pulled from the fallback calendar (since safe fallback is set to true). Since no fallback calendar is explicitly stated, “All Events” will be considered to be the fallback calendar. In this example (grid view), the code will show events (in groups of 4) from the Benton’s calendar. If the Benton’s calendar does not have any events available, then events will be pulled from the fallback calendar (since safe fallback is set to true). Since no fallback calendar is explicitly stated, “All Events” will be considered to be the fallback calendar. Note, because the grid view is in use, a maximum number of events cannot be set. |
[uc-events calendar="The Benton" safe-fallback="true" fallback-calendar="School of Fine Arts" max-number-of-events="12"]
[uc-calendar-grid calendar="The Benton" safe-fallback="true" fallback-calendar="School of Fine Arts"] | In this example (list view), the code will try to show 12 events from the Benton’s calendar. If there are only 4 events happening at the Benton, then only those 4 events will be shown; additional events will not be pulled from the School of Fine Arts calendar. If the Benton’s calendar does not have any events available, then up to 12 events will be pulled from the School of Fine Arts. If the Benton and SFA calendars both do not contain any events, then the no events message/link will be shown. Since the no events message/link are not explicitly set, the default values for those attributes will be used. In this example (grid view), the code will try to show events (in groups of 4) from the Benton’s calendar. If the Benton’s calendar does not have any events available, then events will be pulled from the School of Fine Arts. If the Benton and SFA calendars both do not contain any events, then the no events message will be shown. Since the no events message is not explicitly set, the default value for that attribute will be used. Since this is the grid view, a maximum number of events to display cannot be set. |
[uc-events calendar="The Benton" no-events-message="The Benton has no scheduled events. Please visit the main events calendar to see other Art & Performance events."]
[uc-calendar-grid calendar="The Benton" no-events-message="The Benton has no scheduled events. Please visit the main events calendar to see other Art & Performance events."] | This example contains a custom no events message and no events link. If there are no events at the Benton, then the page will display a linked text message (“The Benton has no scheduled events. Please visit the main events calendar to see other Art & Performance events.”) |