I need the list of CalendarEvent (doctypealias: calendarEvent) under Calendar (doctypealias: calendar) node. On a page (doctyealias:CalendarListPage) has a multi-url picker Calendar (multi-urlproperty) and code grabs its Id. Based on the Id picks list of CalenderEvents
This is what I have in 7.12.3.
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var calendarNode = Umbraco.Content(CurrentPage.calendar.Id);
var calendarEvents = calendarNode.calendarEvents.Where("Visible").OrderBy("StartDateTime");
}
@foreach (var calendarEvent in calendarEvents)
{
code here
}
In version 8 I have
@inherits Umbraco.Web.Mvc.UmbracoViewPage
@{
var calendarNode = Model.Calendar.Id;
var calendarEvents = calendarNode.CalendarEvents;
}
I get an error at CalendarEvents 'int' does not contain a definition of CalendarEvents
Multi-Url Picker in V8.5
Hi, I am in process of upgrading to version 8.
I need the list of CalendarEvent (doctypealias: calendarEvent) under Calendar (doctypealias: calendar) node. On a page (doctyealias:CalendarListPage) has a multi-url picker Calendar (multi-urlproperty) and code grabs its Id. Based on the Id picks list of CalenderEvents
This is what I have in 7.12.3. @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{ var calendarNode = Umbraco.Content(CurrentPage.calendar.Id);
}
@foreach (var calendarEvent in calendarEvents) { code here }
In version 8 I have @inherits Umbraco.Web.Mvc.UmbracoViewPage @{ var calendarNode = Model.Calendar.Id; var calendarEvents = calendarNode.CalendarEvents; }
I get an error at CalendarEvents 'int' does not contain a definition of CalendarEvents
Any insight helpful. -Meg
Hi Meg,
I think you could try:
See if that clears up your error.
Thanks
Nik
Hi Nik,
It gives an error "IPublishedContent" does not contain a definition for "CalendarEvents"
Thanks
I solved it.
@inherits Umbraco.Web.Mvc.UmbracoViewPage
@{ var calendarNode = Model.Calendar.Id; var calendarEvents = Umbraco.Content(calendarNode).ChildrenOfType("calendarEvent"); }
is working on a reply...