Calendar view of events matching multiple tags?

I am working on creating a link on one of our websites that shows a list of events like this one: https://calendar.myschool.edu/arts/all/tags/Tag1%7Tag2

Except I need to know the encoding reference to show events tagged “Tag1” AND “Tag2” only. If you have any insight on this, I would appreciate it!

Great question! In short, there’s not a straightforward way in the url alone to specify what we’d call “tag_mode=all” (as opposed to “any”) in that search result, without some customization (see below).

What you can do is set it as the calendar default, including on a per-calendar basis. So, for instance, the current calendar.myschool.edu configuration in /_ingredients/themes/global/includes/calendar_widget.html can be edited to set tag_mode=all for all /arts/ group URLs.

<xphp content="true">
    <if var="group_directory" equals="/arts/" />
    <content>
        <arg id="tag_mode">all</arg>
    </content>
</xphp>

So that’s one option. The other option might be to do something fancy in that same calendar_widget.html file and use XPHP to look for a GET variable like

<xphp if="match_all_tags" type="GET">
<arg id="tag_mode">all</arg>
</xphp>

Then your hard-coded request could be for /all/tags/tag1|tag2?match_all_tags=1. We’ve seen people successfully do that kind of thing in the past, though I’d recommend testing it on dev first.

Otherwise, the simplest approach would be to do this kind of thing with a Widget instead of on the interactive calendar itself; then you can set all the settings just how you like and show the results on any other page of your website. Hope this helps!