The appearance of your LiveWhale Calendar (or calendar widget in the LiveWhale CMS) is controlled by a number of widget settings and templates from your theme.
Your LiveWhale Calendar homepage likely starts off by including a main_template.html file:
1 | <widget type="file"> |
Editing this file (_i is short for _ingredients) you can start organizing and theming your calendar. main_template.html typically includes:
(Older installations might instead include a calendar_head.html and calendar_template.html from the core theme directly into index.php, but all the same rules of Theme Inheritance still apply.)
In this main_template file (or any file includes you add), you can add/remove and rearrange the main calendar elements. You’ll need <xphp var="lw_calendar_view_menu"/>
to display the day/week/month/all view selector, as well as <xphp var="lw_calendar"/>
for the body of the calendar.
Beyond that, you can choose from the following sidebar elements, and customize them further with their individual components (below).
Sidebar Element | Tag | Required settings in calendar_widget.html |
---|---|---|
Search box | <xphp var="lw_calendar_search"/> |
none |
“Subscribe” button | <xphp var="lw_calendar_subscribe"/> |
none |
Mini-cal date picker | <xphp var="lw_calendar_mini_cal"/> |
none |
Drop-down calendar group navigation | <xphp var="lw_calendar_calendars"/> |
none |
Filter by group | <xphp var="lw_calendar_groups"/> |
<arg id="show_groups">true</arg> |
Filter by event type | <xphp var="lw_calendar_categories"/> |
<arg id="show_categories">true</arg> |
Filter by campus | <xphp var="lw_calendar_categories_campus"/> |
<arg id="show_categories">true</arg> |
Filter by audience | <xphp var="lw_calendar_categories_audience"/> |
<arg id="show_categories">true</arg> |
Filter by tags | <xphp var="lw_calendar_tags"/> |
<arg id="show_tags">true</arg> |
Filter by locations | <xphp var="lw_calendar_locations"/> |
<arg id="show_locations">true</arg> |
In general, the above filters will show all starred, global options (e.g. starred global tags, starred event types, etc.) on the front-end displays. Learn more about customizing those filters.
You may want to exclude a certain tag or event type from one group’s calendar, for instance. You can do this by creating a custom calendar_widget.html in the group that matches your theme name.
For example, in the “music” group, /_ingredients/themes/global/includes/calendar_widget.html will be overridden by /_ingredients/themes/music/includes/calendar_widget.html.
While the above includes manage the things around your calendar, you’ll edit your calendar’s components to tweak the appearance and functionality of individual pieces of the calendar, like the event view, day view, date selector, and more.
If you copy/edit any of the following to /_ingredients/themes/global/templates/calendar/, they will override the defaults from the core theme. (For some clients, we’ve copied them already to /_ingredients/themes/global/templates/move_to_calendar_to_customize/ as a courtesy.)
(Note for existing clients: You may be on a legacy setup where the below components are combined into calendar.html and calendar_components.html files. Contact Support to discuss moving to this new setup in your next upgrade.)
Component | Description |
---|---|
lw_cal_all.html | The “all upcoming events” view |
lw_cal_day.html | The “day” view |
lw_cal_event.html | An individual event listing in the day/week/all views |
lw_cal_event_detail.html | An individual event page |
lw_cal_month.html | The “month” view |
lw_cal_month_day.html | An individual day in the month view |
lw_cal_week.html | The “week” view |
lw_cal_list.html | A list of events (used in week/all views) |
Component | Description |
---|---|
lw_cal_feature.html | Featured event listing <div id="lw_cal_feature"></div> |
lw_cal_feature_item.html | An individual event in the featured listing |
lw_cal_feature_top.html | The first event in the featured listing |
lw_cal_feed_builder.html | Tool for building subscription feeds (view/feed_builder ) |
lw_cal_feed_selector.html | Individual selector in the feed_builder tool |
lw_cal_home.html | The “home” view (view/home ) |
lw_cal_home_event.html | An individual event listing in the home view |
Note: Your calendar installation might not support or have styling for the above optional views. Contact Support if you’re interested in enabling the home, featured, or feed_builder views.
Component | Description |
---|---|
lw_cal_calendars.html | “Calendar:” drop-down navigation pointing to all your group calendars |
lw_cal_categories.html | “Show Only:” checkbox menu for filtering by Event Type |
lw_cal_categories_audience.html | “Show Only:” checkbox menu for filtering by Event Type: Audience |
lw_cal_categories_campus.html | “Show Only:” checkbox menu for filtering by Event Type: Campus |
lw_cal_date_selector.html | Drop-down navigation for jumping to a nearby date or date range |
lw_cal_event_images.html | Image, caption, and credit for all event images |
lw_cal_event_related_content.html | Links to all content related to an event |
lw_cal_event_share_icons.html | Social media sharing icons |
lw_cal_groups.html | “Calendar:” checkbox navigation for filtering by group |
lw_cal_header.html | Header containing scroll_link, date_selector, header text, and “currently showing” text |
lw_cal_locations.html | “Location:” checkbox menu for filtering by location |
lw_cal_mini_cal.html | Mini calendar |
lw_cal_no_results.html | Text that appears when no events are found |
lw_cal_scroll_link.html | Previous/next arrows |
lw_cal_search.html | Search header and input |
lw_cal_subscribe.html | Subscribe button |
lw_cal_subscription_menu.html | Subcribe button pop-up |
lw_cal_tags.html | Menu for filtering by tags |
lw_cal_timezone_menu.html | Pop-up menu to change your timezone |
lw_cal_view_selector.html | Menu for day/week/month/all views |
Your calendar page will render and load /_ingredients/themes/global/styles/calendar.less on every view by default.
If you have a different or additional theme set (say, a custom “music” theme for the “music” group), it will also load the associated /_ingredients/themes/music/styles/calendar.less, if one exists.
You’ll notice your calendar.less begins with something like this:
1 | /* Import core calendar styles */ |
This is very important— including these styles and mobile mixins allow you to build on top of the existing core calendar styles from LiveWhale, rather than starting from scratch. It also means that the next time you are upgraded, any changes to the core theme/UI will filter down into your theme with minimal work.
There are also a few default variables you’ll inherit from the core theme, but can override in your own calendar.less should you choose:
1 | @highlight1: #c00; // Primary color |
At minimum, we recommend setting your school color(s) to the @higlight1
and @highlight2
variables in /_ingredients/themes/global/styles/calendar.less. You may want to do more hands-on styling of individual elements, but this will do a first-pass at matching the various UI elements to your chosen colors.
The calendar-mobile.less include doesn’t generate any rendered CSS, but rather provides a few mixins that you can choose to include in your own style, to allow for custom mobile breakpoints and styling.
Mobile Mixin | Description |
---|---|
.mobileMonthViewList() |
Display month view as a list of events |
.mobileMonthGridList() |
Display month view as a grid of dots |
.mobilePaymentsTable() |
Display RSVP form in a single column |
.mobileViewSelector() |
Display pared-down view selector |
1 | /* Import core calendar mobile mixins */ |
If you create a /_ingredients/themes/global/scripts/calendar-custom.js, it will be loaded in every view of your front-end calendar. This can be used to implement additional JavaScript or jQuery customization on top of the default calendar behavior.
The below template for calendar-custom.js aliases the livewhale.jQuery object for you to use as $
. Note also, there are several JavaScript triggers you can bind to, in order to run custom code at particular times or for particular views.
1 | (function($, LW) { |
By default, LiveWhale will display all your calendar event types and tags as front-end filters, using the following theme tags:
1 | <xphp var="lw_calendar_categories"/> |
Event types will only show up after they’ve been applied to events (same with starred tags)—so, if your Athletics calendar doesn’t have any “Performance” events, that event type won’t show up in the filter list on the Athletics calendar.
However, there may be times when you want to control the front-end display of event types and tags more granularly. Since LiveWhale 1.7, you can do so by adding the following settings in /livewhale/client/public.config.php:
1 | $_LW->CONFIG['CALENDAR_GROUP_CATEGORIES_TYPE']=[]; |
Each of those arrays takes the same format: first, the group ID, then a sub-array of all event types allowed to be displayed in that group. For example:
1 | $_LW->CONFIG['CALENDAR_GROUP_CATEGORIES_TYPE']=[ |
These act as filters on top of the default behavior: so, in the example settings above, group 123 will still only show “Athletics” in the filter list if there are events with that type in the group. However, group 789 will not show the filter “Athletics,” even if there are Athletics events in the group.