For my client I have to make a calender where he can add/delete/modify and read events. You can have multiple events on one day and there has to be a title of the event, a location and a time (properties). Any experience with this?
What we do is create a new document type for the events and add some fields (screenshot attached), we create a folder document type for this where all of the events will live and then on the template for that folder we drop in this: https://fullcalendar.io/
We also create a view that renders the JSON to populate the fullcalendar plugin.
You have tons of control over what fields you want, whether you want a map datatype on there, etc. Makes it super easy to customize.
Here's a template for the JSON
@foreach(var page in selection){
if(page.IsLast()){
var news = new {
title = @page.eventTitle,
start = @page.startDateAndTime.ToString("yyyy-MM-ddTHH:mm"),
end = @page.endDateAndTime.ToString("yyyy-MM-ddTHH:mm"),
url = @page.Url
};
@Html.Raw(Json.Encode(news))
} else {
var news = new {
title = @page.eventTitle,
start = @page.startDateAndTime.ToString("yyyy-MM-ddTHH:mm"),
end = @page.endDateAndTime.ToString("yyyy-MM-ddTHH:mm"),
url = @page.Url
};
@Html.Raw(Json.Encode(news) + ",")
}
}
]
I am trying to do something similar like your example above however I dont seem to understand how the JSON from the pages get added to the calendar.
I have created a Document Type for the Calendar Events.
I have created a Document Type for a page to display the Calendar, and I have added the Events document type as a child item.
I have created a partial view to fetch all the child events from my Calendar page but I'm now stuck on how to get that data to display in the calendar. Any help you could provide would be appreciated.
Here is my partial view code
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var selection = Umbraco.TypedContent(1344).Children("booking")
.Where(x => x.IsVisible());
}
@foreach (var item in selection)
{
var startDate = item.GetPropertyValue<DateTime>("bookingStartDate");
var endDate = item.GetPropertyValue<DateTime>("bookingEndDate");
if (item.IsLast())
{
var booking = new
{
title = "Unavailable",
start = startDate.ToString("dd,MM,yyyy"),
end = endDate.ToString("dd,MM,yyyy")
};
@Html.Raw(Json.Encode(booking))
}
else
{
var booking = new
{
title = "Unavailable",
start = startDate.ToString("dd,MM,yyyy"),
end = endDate.ToString("dd,MM,yyyy")
};
@Html.Raw(Json.Encode(booking) + ",")
}
}
Thanks for the replies, I will check them out and let you know what's working. This calendar looks great in my opinion but I'll have to figure out how it's gonna work with Umbraco: http://w3widgets.com/responsive-calendar/
Calendar
Hi,
For my client I have to make a calender where he can add/delete/modify and read events. You can have multiple events on one day and there has to be a title of the event, a location and a time (properties). Any experience with this?
Kind regards,
Benoit
Hi Benoit
Is it what are you looking for - https://our.umbraco.org/projects/backoffice-extensions/eventcalendar/?
Thanks,
Alex
Hi Alex,
Seems to be what I'm looking for but it's not for free... Any other suggestions?
Kind regards,
Benoit
I haven't tried this myself but how about this one;
https://github.com/Mantus667/EventCalendarBelle
Thanks
They are the same (ie, the backoffice extension above and the GitHub project); has the licensing changed?
Hi Benoit,
What we do is create a new document type for the events and add some fields (screenshot attached), we create a folder document type for this where all of the events will live and then on the template for that folder we drop in this: https://fullcalendar.io/
We also create a view that renders the JSON to populate the fullcalendar plugin.
You have tons of control over what fields you want, whether you want a map datatype on there, etc. Makes it super easy to customize.
Here's a template for the JSON
Hope this helps!
Amir
Hi Amir,
I am trying to do something similar like your example above however I dont seem to understand how the JSON from the pages get added to the calendar.
I have created a Document Type for the Calendar Events.
I have created a Document Type for a page to display the Calendar, and I have added the Events document type as a child item.
I have created a partial view to fetch all the child events from my Calendar page but I'm now stuck on how to get that data to display in the calendar. Any help you could provide would be appreciated.
Here is my partial view code
Kind Regards Eric
Have you found the solution for this? Could you please advise me?
Hi Thao,
Please see below the code I finally got working. Hope it helps
First up is the partial view to return the events in the calendar on my main Availability page.
And on the Availability page I add this code
Finally I add the javascript at the bottom to create a listener amd display the dates that are unavailable.
If you want to see it in action please see the website I designed this for.
BemersydeEstate.com by Arca Studios
Thank you for posting this!
http://endzonesoftware.com/combining-fullcalendar-ks-umbraco7-calendar-create-great-umbraco-events-listing/
Thanks for the replies, I will check them out and let you know what's working. This calendar looks great in my opinion but I'll have to figure out how it's gonna work with Umbraco: http://w3widgets.com/responsive-calendar/
Kind regards,
Benoit
is working on a reply...