Home › Forums › Calendar Products › Events Calendar PRO › Set Default category for calendar view
- This topic has 8 replies, 3 voices, and was last updated 8 years ago by Support Droid.
-
AuthorPosts
-
April 5, 2016 at 8:07 am #1098315MichelleParticipant
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.April 5, 2016 at 8:39 am #1098333GeoffMemberHey 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!
GeoffApril 6, 2016 at 7:42 am #1098922MichelleParticipantYes, 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?
April 6, 2016 at 7:47 am #1098926GeoffMemberis 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,
GeoffApril 6, 2016 at 8:26 am #1098943MichelleParticipantDo you think you could give me any insight on what that javascript should be?
April 6, 2016 at 2:28 pm #1099197GeoffMemberSure! It will likely be structured similar to this:
$('[the-thing-to-select]').prop( "checked", true );
Geoff
April 7, 2016 at 5:56 am #1099499MichelleParticipantOkay 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?
April 7, 2016 at 7:31 am #1099544GeoffMemberPerhaps waiting to fire the script until the page is fully loaded will help:
$( document ).ready(function() { $('[the-thing-to-select]').prop( "checked", true ); });
Geoff
April 22, 2016 at 9:35 am #1105962Support DroidKeymasterThis 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. -
AuthorPosts
- The topic ‘Set Default category for calendar view’ is closed to new replies.