Override Calendar Args via URL?

Our main events calendar uses an arg to exclude non-public events…
<arg id="exclude_category">Non-public</arg>

In widgets, you can include an empty arg to override saved settings like, <arg id="exclude_category"></arg>.

But is there any way to customize a calendar URL to override that setting such that those events will appear? I tried adding a parameter without a value like /events/calendar/exclude_category. But that doesn’t seem to work.

One trick I’ve seen in the past is using a GET variable? i.e. something like ?include_non_public=1 and then you can set your calendar_settings.html (or wherever your widget type=“events_calendar” code is) and have some XPHP in there that looks for the GET variable and changes the underlying setting in that case. Hope this helps!

Or, you could always set up a 2nd calendar on another page (there are ways of doing this in LWC and CMS) that shows the broader category/categories and then link out to that as needed.

I’m trying to avoid creating a second calendar page just for this instance. I’d rather just drop a widget on a page instead.

But if this user really prefers a calendar, the GET variable could work. Should be simple enough XPHP. Thanks for the idea.

I got this to work by adding this in the calendar widget…

<xphp if="include_non_public" type="get" value="">
    <arg id="exclude_category">Non-public</arg>
</xphp>

The exclude_category arg only gets added in the absence of the ?include_non_public URL parameter.

There is a caveat, though. That parameter is lost if the user navigates around the calendar, i.e., switching to month view, etc. So this may not be ideal.