Set Default category for calendar view

Home Forums Calendar Products Events Calendar PRO Set Default category for calendar view

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1098315
    Michelle
    Participant

    I have the FilterBar add on, along with Events Calendar Pro, is there a way to have the main calendar page only show a default category(s)? Users would then be able to check on additional categories if necessary but the initial view would only show a handful of categories.

    Use Case:
    We have 60 different categories for all departments, with hundreds of events, however we want our main event calendar to only show corporate events by default.

    #1098333
    Geoff
    Member

    Hey there and welcome to the forums! I hope you’ve been enjoying the plugins so far. 🙂

    Great question. While there is no way to set a default category for the calendar view, you could link directly to a specific category instead of your main calendar, which will then allow visitors to use the Filter Bar to customize the view from there.

    If you have a category called Concert, then you would link directly to:

    [your-site]/events/category/concert

    Does this make sense and will it work for you? Please let me know. 🙂

    Cheers!
    Geoff

    #1098922
    Michelle
    Participant

    Yes, we currently do that for our categories, but for our main calendar we did want to have ALL event categories be available but to only have it default to a particular category. As an absolute fall back, I guess we could do that, but I was wondering if there was a way to simply default the filter bar to only have specific categories selected.

    I know the filter bar uses javascript to pull in category data via ajax, is there a way to add in some additional JS to my page to automatically default the filterbar to Category A?

    #1098926
    Geoff
    Member

    is there a way to add in some additional JS to my page to automatically default the filterbar to Category A?

    Absolutely! You can certainly inject JS (or jQuery) into your template to select a category once the page has loaded.

    Sorry there isn’t a simple setting for something like this in the plugin itself, but hopefully either the category or JS ideas will help you work around this.

    Cheers,
    Geoff

    #1098943
    Michelle
    Participant

    Do you think you could give me any insight on what that javascript should be?

    #1099197
    Geoff
    Member

    Sure! It will likely be structured similar to this:

    $('[the-thing-to-select]').prop( "checked", true );

    Geoff

    #1099499
    Michelle
    Participant

    Okay so that will check the box in the filter bar, I got that, but it does NOT fire off the AJAX request to update the calendar view with only those events from selected category.

    Any other advice?

    #1099544
    Geoff
    Member

    Perhaps waiting to fire the script until the page is fully loaded will help:

    $( document ).ready(function() {
    $('[the-thing-to-select]').prop( "checked", true );
    });

    Geoff

    #1105962
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Set Default category for calendar view’ is closed to new replies.