Our special needs school has a number of events scheduled throughout the school year and events are assigned one of several different predefined categories.
I need to display a school calendar list that pulls information out of a custom school calendar widget that shows holidays, staff training days, etc. and displays the information by month. I also need to include events by month and category in this list.
I have all of this working nicely but have run into an issue I didn't anticipate. We generally un-publish events a week after the event date has passed. The problem is that my list doesn't show un-published events which makes it look like we've had no events from July 1, 2013 (the beginning of our current school year) to November 2013.
Here's what the code that gets events be category looks like. Any thoughts?
nlgEventCategory = EventUtilities.GeneralNLGEvents;
Taxon generalNLGCategoryTaxon = TaxonUtilities.GetCategoryByTitle(nlgEventCategory);
List<Event> nlgEventItems = EventUtilities.GetEventByCategory(generalNLGCategoryTaxon.Id);
List<Event> GetEventByCategory(Guid categoryId)
var taxonomyMgr = TaxonomyManager.GetManager();
var eventMgr = EventsManager.GetManager();
// Get the Id of the category
var taxonId = taxonomyMgr.GetTaxa<HierarchicalTaxon>()
.Where(t => t.Id == categoryId)
// Get all event items that are assigned to this category
var eventItemsInCategory = eventMgr.GetEvents().Where(p => p.Status == ContentLifecycleStatus.Live && p.GetValue<TrackedList<Guid>>(
Thanks -- Steve