Full calendar allows you to render various content as calendar events.
- Kentico 12.0.41 or later version is required to use this component.
- Autofac 3.5.2 for resolving dependency injection
- Download and install widget:
- Install widget through nuget package
- Download nuget package from this link
- Setup local nugetfeed and copy nuget package EXLRT.Kentico.Mvc.Widgets.FullCalendar.1.0.0.nupkg to newly created feed.
- Install package to your MVC solution
- Install widget by source code
- Clone this repostiory to your file system: https://github.com/drilic/kentico-mvcwidget-fullcalendar
- Link EXLRT.Kentico.Mvc.Widgets.FullCalendar.csproj as existing project
- Copy files to exact same structure in MVC project:
- Views\Shared\Widgets\FullCalendarWidget\_FullCalendarWidget.cshtml
- Views\Shared\FormComponents\FullCalendarTypeSelector\_FormComponents.FullCalendarTypeSelector.cshtml
- Content\Widgets\FullCalendar\css\fullCalendar.css
- Content\Widgets\FullCalendar\js\fullCalendar.js
- Add project as reference to the MVC project
- Build solution
- Install widget through nuget package
- Configure routing for widget
- Register dependency injection
- Setup predefined calendars
- Calendars can be configured per site, but name must be unique globally
- Register necessary styles and scripts for full calendar in layout
Method definition:
void MapFullCalendarRoutes(this RouteCollection routes, MvcRouteHandler routeHandler = null, object constraint = null, CultureInfo defaultCulture = null);
Example of configuration for DancingGoat site (RouteConfig.cs):
using EXLRT.Kentico.Mvc.Widgets.FullCalendar;
...
routes.MapFullCalendarRoutes(new MultiCultureMvcRouteHandler(defaultCulture), new { culture = new SiteCultureConstraint() }, defaultCulture);
Method definition:
void RegisterFullCalendarDependencies(this ContainerBuilder builder);
Example of configuration for DancingGoat site (DependencyResolverConfig.cs):
using EXLRT.Kentico.Mvc.Widgets.FullCalendar;
...
builder.RegisterFullCalendarDependencies();
Method definition:
Dictionary<string, FullCalendarWidgetConfiguration> AddConfiguration(this Dictionary<string, FullCalendarWidgetConfiguration> _, string widgetType, FullCalendarConfigurationType configurationType, string classOrObjectName, string widgetTypeDisplayName, string titleColumnName, string startDateColumnName, string endDateColumnName, UrlConfiguration url = null, string descriptionColumnName = null, string allDayColumnName = null, string siteCodeName = null);
Example of configuration for DancingGoat site (ApplicationConfig.cs):
using EXLRT.Kentico.Mvc.Widgets.FullCalendar;
...
FullCalendarConfiguration.InitializeFullCalendarForMultiCultureSites()
.AddConfiguration("articles", FullCalendarConfigurationType.Pages, "DancingGoatMvc.Article",
"Articles (Pages)", "DocumentName", "DocumentPublishFrom", "DocumentPublishTo", new UrlConfiguration()
{
Pattern = "/#DocumentCulture#/Articles/#NodeGUID#/#NodeAlias#",
Columns = new string[] { "DocumentCulture", "NodeAlias", "NodeGUID" }
})
// Objects bellow does not exist in DancingGoat sample. They must be created in Kentico CMS before using
.AddConfiguration("events", FullCalendarConfigurationType.CustomTables, "customtable.Events",
"Events (Custom Tables)", "ItemName", "StartDate", "EndDate", descriptionColumnName: "Description")
.AddConfiguration("classes", FullCalendarConfigurationType.Classes, "dancinggoat.Events",
"Events (Module Classes)", "EventsName", "EventsStartDate", "EventsEndDate");
Example of configuration for DancingGoat site (_Layout.cshtml):
@using EXLRT.Kentico.Mvc.Widgets.FullCalendar.Extensions;
...
<head>
...
@Html.RenderFullCalendarStyles()
</head>
<body>
...
@Html.RenderFullCalendarScripts();
</body>
Feel free to fork and submit pull requests or report issues to contribute. Either this way or another one, we will look into them as soon as possible.