Kentico: Installing the connector
In this article you’ll find:
Goal
This article provides information on how to install the connector to a Kentico project.
Prerequisite
The backend website must be on Kentico 13 for NuGet version 13.x.x or at least Kentico 12.0.29 for the version 12.x.x NuGet.
The frontend website needs to be an ASP .NET Core MVC for the version 13.x.x NuGet or an ASP .NET Web Application for the version 12.x.x NuGet.
Corresponding version of Kentico connector NuGet package:
Install from the following NuGet repository - https://developer.hawksearch.com/nuget
Install the NuGet from local repository - Place the NuGet package in a local folder on your workstation and set it as Package source in Visual Studio
Kentico 13 - NuGet version 13.x.x
Kentico 12 - NuGet version 12.x.x
Steps to install the connector
Live frontend project
Kentico 13
Install the Hawksearch.Kentico.Xperience.UI NuGet package.
In the startup ConfigureServices method, add the “AddHawksearchConnector()” extension method on the result of “AddControllersWithViews()”.
In the same method, add a call to “AddHawksearchViews()” to the IServiceCollection.
In the Configure method, add a call to “UseHawksearchConnector()“ on the IApplicationBuilder.
In your layout file, there are a few things that need to be added.
<!DOCTYPE html> @{ var settings = CMS.Core.Service.Resolve<Hawksearch.Kentico.Xperience.CMS.Configuration.IConnectorSettingsProvider>().GetSettings(); } <html> <head> <meta name="viewport" content="width=device-width" /> <title>@ViewBag.Title</title> <page-builder-styles /> @if (settings.FrontendFramework == Hawksearch.Kentico.Xperience.CMS.Configuration.FrontendFrameworkType.React) { <link rel="stylesheet" href="/assets/hawksearch/react/dist/main.css" /> } </head> <body> <div> @RenderBody() </div> <page-builder-scripts /> @if (settings.FrontendFramework == Hawksearch.Kentico.Xperience.CMS.Configuration.FrontendFrameworkType.Vue) { <script src="/assets/hawksearch/vue/dist/main.js"></script> } else { <script src="/assets/hawksearch/react/dist/main.js"></script> } </body> </html>
Rebuild your solution.
The namespace for all the extension methods is Hawksearch.Kentico.Xperience.Configuration.
ConfigureServices method:
services.AddControllersWithViews().AddHawksearchConnector();
Configure method:
app.UseHawksearchConnector();
Kentico 12
Install the Hawksearch.Kentico.Xperience.UI NuGet package.
In your main web.config file, add the following lines:
In your layout file, there are a few things that need to be added.
Backend CMSApp project
Install the Hawksearch.Kentico.Xperience.CMS NuGet package.
Rebuild your solution.
Run the CMSApp project and make sure at least one request passes through. Kentico will automatically install all required objects in the database.