I’d like to change our filter for groups from a drop-down with checkboxes for group names to a “jump to calendar” drop-down menu like Berkeley and Colby have on their sites.
The difference being that in the first setup, when you check a group name like “Human Resources” it takes you to “CMU Events Calendar” which is essentially still a main calendar page with the subtitle “Showing events from Human Resources” while the second setup takes you to the group’s dedicated calendar URL e.g. “Human Resources – CMU Events Calendar” with the group-specific page title.
To do this, do we just change div id=“lw_cal_group_selector” to div id = “lw_cal_calendar_selector” in the code?
That’s right – you’ll want to test it on dev first of course, like any theming change, but it should be a straightforward switch. There are some formatting tasks you might run into while doing this that I’ll mention below.
Group Selector
<xphp var="lw_calendar_groups"/>
is the same as <div id = "lw_cal_group_selector"/>
This shows a checkbox filter list of groups that have events included in the current calendar results. Checking one or more off off filters the current view.
Calendar Selector
<xphp var="lw_calendar_calendars"/>
is the same as <div id = "lw_cal_calendar_selector"/>
This shows a list of links to group calendars (i.e., any group with a “Calendar URL” set in the group settings), prepended by a link to “Main Calendar.” Clicking any link takes you to that group calendar landing page.
The Main Calendar name you can also customize by uncommenting and editing this line of livewhale/client/public.config.php:
//$_LW->REGISTERED_WIDGETS['events']['custom']['main_calendar_title']=''; // if you wish to customize the title of the main homepage calendar in the calendar dropdown, set it here
One thing to be aware of: often times your theming might include customizations to the lw_cal_groups.html component to give it certain styling or interactivity. A lot of recent calendars use some accordion-style filter dropdown markup there.
This means, if you are switching to lw_cal_calendars.html and it hasn’t been styled before, you may need to copy some of the HTML formatting from lw_cal_groups.html into there (duplicating the file in _ingredients/themes/global/components/calendar/) in order to get it to look the same. The list itself would stay a list of <a href="..." links instead of <input type="checkbox"... of course, but that outer HTML might want updating. Feel free to reach out using the Request Help Form if you’d like hands-on help from our developers making that switch.