Add Events Using Shortcode
Alexa Biron
Janet Vamos
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 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.
Additional attributes can be added to customize and filter the events that are displayed.
The shortcode behaves in the same way as the widget 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"] | |
event-type | string | By default, this filter is not applied. | [uc-events event-type="Art & Performance"] | |
audience | string | By default, this filter is not applied. | [uc-events audience="Prospective Students"] | |
campus | string | By default, this filter is not applied. | [uc-events campus="Storrs"] | |
tag | string | By default, this filter is not applied. | [uc-events 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"]
Attribute | Attribute Type | Default Value | Shortcode Example |
---|
Attribute | Attribute Type | Default Value | Shortcode Example |
---|---|---|---|
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] |
safe-fallback | boolean | false | [uc-events safe-fallback=true] |
fallback-calendar | string | All Events | [uc-events 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." | [uc-events 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 Widget section above.
Shortcode | Description |
---|
Shortcode | Description |
---|---|
[uc-events 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"] | 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"] | 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"] | 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"] | In this example, 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. |
[uc-events calendar="The Benton" safe-fallback="true" fallback-calendar="School of Fine Arts" max-number-of-events="12"] | In this example, 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. |
[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." no-events-link="https://events.uconn.edu/all/categories/Art%20%26%20Performance "] | 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.”) |