Totara Learn Open Discussions

Seminar Events: Filter by location

 
Vijay Rudraraju
Seminar Events: Filter by location
by Vijay Rudraraju - Wednesday, 23 March 2022, 4:29 PM
 

Hi,

We will be running multiple events across multiple locations (52 different office locations set up as an event custom field i.e. via /mod/facetoface/customfields.php?prefix=facetofacesession).

Since there will be 200 to 300 events every year - it would be handy for the learners and admins to be able to filter by Location (or the default Room).

As illustrated by the image attached, is it possible to filter Upcoming and Past Events by Location?

Any code or block that can be used for this?



Craig Eves
Re: Seminar Events: Filter by location
by Craig Eves (Totara Support) - Thursday, 24 March 2022, 7:43 PM
Group Totara

Hi Vijay

Under Seminar Global setting there is Add calendar filters . If you add a custom field for the Seminar room then the custom field will appear here 


I am not sure where the filter appears - I tried in TXP 15 and this didn't show - I may need more data for this to show or another location as sounds like it appears in the Calendar 


Regards


Vijay Rudraraju
Re: Seminar Events: Filter by location
by Vijay Rudraraju - Sunday, 27 March 2022, 2:35 PM
 

Thanks for your prompt reply and for the proposed solution.

I am not seeing these filters either in TL v13 when I visit the calendar for the course #905 at /calendar/view.php?view=upcoming&course=905 

Or is this global calendar at a different location? Sorry, not all admin menus are available for me.


However, as illustrated below, the preference would be to see such filters either:

  • when I click on the seminar name e.g. Test Seminar below (/mod/facetoface/view.php?id=3589)
    or 
  • when I click View all events (/mod/facetoface/view.php?f=2041).





Craig Eves
Re: Seminar Events: Filter by location
by Craig Eves (Totara Support) - Sunday, 27 March 2022, 3:52 PM
Group Totara

Hi Vijay

I was able to find the filter on the calendar  - it doesn't appear on the calendar block but appears when you click the month as a learner in the course.- with the link like sitename/calendar/view.php?view=month&time=1648421114&course=100 


I agree this would be better to appear on the Event view report - unfortunately this isn't a report builder report so would require a feature request to implement this.

Regards


Vijay Rudraraju
Re: Seminar Events: Filter by location
by Vijay Rudraraju - Wednesday, 25 May 2022, 5:41 PM
 

Thanks Heaps Craig, 

The calendar method is a great suggestion. However, with 3 clicks to sign-up, our learners may be distracted away from the signup process.


Simple JavaScript Method

I was keen to keep it simple and hassle-free. 



I came up with some simple script that could be added to the Additional HTML section on our site to filter upcoming sessions in Totara LMS based on a 'location' custom field:

  • Trainers add a location - via a custom field to the event.
  • The script should:
    1. Hide all events on load.
    2. Create a dynamic dropdown list based on 'locations' for a given seminar page (i.e. first column in Event View report table).
    3. Only show upcoming events for the location chosen.
    4. Show all scheduled events when 'All locations' is selected.
  • The Previous events list is not modified.

I created a code pen with the required JavaScript that I wish to share for anyone interested. My JavaScript skills are rusty so any improvements are most welcome.

https://codepen.io/vj/pen/PoQWXvb


Thanks again for your support!

Vijay Rudraraju
Re: Seminar Events: Filter by location
by Vijay Rudraraju - Friday, 16 September 2022, 7:06 PM
 

Thanks Craig, 


We decided to go with the built-in rooms feature and renamed rooms as locations. 


Room ID helps us filter. For example, /mod/facetoface/view.php?id=4131&roomid=405 only shows 'Hawthorn' sessions


Can I use roomid with the calendar? for example, filter by courseid 931, then by roomid?

/calendar/view.php?view=month&course=931&time=1661954400&roomid=405

Vijay Rudraraju
Re: Seminar Events: Filter by location
by Vijay Rudraraju - Friday, 10 February 2023, 7:41 PM
 

Thanks Craig. 

For anyone looking for a solution to Filter Seminar Events By Location In Totara LMS (trainwell.com.au), I provide detailed step-by-step instructions and code.

A dynamic Site filter allows users to view events just for the selected location (as illustrated below)

A dynamic Site filter allows users to view events just for the selected location