Set default tags for a group?

We have a global “Exclude from Main Calendar” tag that groups can add to events they do not want to filter up to the main university calendar. When setting up a group is there a way to make this tag show up in all of their events by default, so all events are excluded unless they remove the tag? For some units this just makes more sense as they have more events to exclude than include.

In the group editor, you can set default categories for all new events in that group, but I don’t think you can set default tags. We have a category called non-public that we use for the same purpose (excluding from the main calendar). It might be a lot of work, but perhaps you could move that tag to a category.

Thanks, Jon.

@karl is there any way to set a default tag, or would we have to do what Jon suggests, making “exclude from main calendar” a category? What are the pros and cons of that and how complicated would it be? If we are going to do it I would want to do it now before we onboard more units.

I’ll let Karl weigh in too, but if it were me, this is how I would do it.

  1. Add a new category called “exclude from main calendar”. Make sure it isn’t starred so it doesn’t show in the list of categories on the front end calendar.
  2. Set your main calendar to also exclude events in that category, but keep it excluding the tag too.
  3. Start using the category on new events instead of the tag.
  4. Time permitting, begin editing existing and past events to add the category and remove the tag. This can be done over time since the calendar excludes them both.
  5. Once all events have been switched, remove the tag.

Depending on how many events are tagged that way, #4 could possibly be automated with a small script.

@jwilcox by category you mean Event Type, right?

Yes, sorry Event Types

I think what Jon is describing would work, for sure!

The other option would be a quick backend.js customization that could say “If on the event editor, and adding a New Event (i.e. livewhale.editor.id is empty) then pre-select the Exclude from Main Calendar tag if certain criteria are met (i.e. if you’re in one of these group IDs, say)” would require a little coding work but could probably be accomplished in under an hour, I’d estimate. Hope this helps!

I think I am going to pursue Jon’s solution since it is DIY and we don’t have that many events with that tag yet so removing it from events should not take long. Karl, I will email support if I run into any issues and need to pursue a customization option instead. Thank you both!

1 Like

OK did everything Jon suggested (I think) but it is not working. For step 2 above, “Set your main calendar to also exclude events in that category, but keep it excluding the tag too” do I do this just by unchecking the box for Exclude from Main Calendar under Available Global Content Types in the Group settings? Or is this something I have to ask one of my developers to do in the code? If it is the latter, that would be why it is not working.

The calendar widget arguments will need to be edited to exclude that event type. That is probably a task for a developer if you don’t have access/are not comfortable editing that yourself.

Yeah since I am a comms person and not a developer I don’t have access to the code or know how to do that. Would you (or Karl) mind providing exact instructions that I can pass along to our developer to do? Really appreciate your help here, Jon!

In your calendar template you have a widget that looks something like this:

<widget type="events_calendar">
    <arg id="mini_cal_heat_map">true</arg>
    <arg id="thumb_width">200</arg>
    <arg id="thumb_height">200</arg>
    <arg id="hide_repeats">false</arg>
    <arg id="show_groups">true</arg>
    <arg id="show_locations">false</arg>
    <arg id="show_tags">true</arg>
    <arg id="month_view_day_limit">2</arg>
    <arg id="use_tag_classes">false</arg>
    <arg id="search_all_events_only">true</arg>
    <arg id="use_modular_templates">true</arg>
    <arg id="display_all_day_events_last">true</arg>
    <arg id="exclude_tag">exclude from main calendar</arg>
</widget>

You need to add one more arg inside that widget that looks like this:

<arg id="exclude_category">exclude from main calendar</arg>

thanks - will pass this along to our dev team!

Just make sure that the value inside that arg is exactly the same as how you named that event type. So, it may be this if that’s how you capitalized it…
<arg id="exclude_category">Exclude from Main Calendar</arg>

Took a little fiddling but our dev folks got this code added so the new 'Exclude from Main Calendar" Event Type now works as intended, and the tag is gone - thanks again for your help, @jwilcox!

2 Likes