This is a sample ASP.NET Core MVC app that uses the Kentico Kontent Delivery .NET SDK to retrieve content from Kentico Kontent.
To run the app:
-
Clone the app repository with your favorite GIT client
-
Open the DancingGoat.sln solution file in VS or VS Code
-
Run the app
-
Follow the setup wizard or
-
Alternatively, adjust the
\DancingGoat\appsettings.json
file:"DeliveryOptions": { "ProjectId": "YOUR_PROJECT_ID", },
Follow the step-by-step tutorial for even more details.
Content contributors sometimes need to fix errors or typos right when they see them on the website. The sample app allows users to navigate from a piece of content on the site straight to the corresponding content item or element in Kentico Kontent.
To see Edit mode in action:
-
Enable Delivery Preview API by adding the following keys to the
\DancingGoat\appsettings.json
file:"DeliveryOptions": { "UsePreviewApi": true, "PreviewApiKey": "YOUR_DELIVERY_PREVIEW_API_KEY" },
- Delivery Preview API: Create a new key named
PreviewApiKey
in theDeliveryOptions
section, and use the Delivery Preview API key as its value. To enable calls over the Delivery Preview API, you also need to add a key namedUsePreviewApi
and set it totrue
.
- Delivery Preview API: Create a new key named
-
Run the app.
-
Navigate to the About us section.
-
Click the Edit mode switch in the bottom-left corner.
Edit buttons will appear next to each piece of content on the page.
To explore how the functionality is implemented, navigate to the TagHelpers
folder.
The sample app contains a sample implementation of the img-asset
tag helper from the Kentico.Kontent.AspNetCore NuGet package. Using the img-asset
tag helper, you can easily create an img
tag with srcset
and sizes
attributes. Read more about image transformation API in the docs.
You can adjust the behavir in the appsettings.json
file.
"ImageTransformationOptions": {
"ResponsiveWidths": [ 200, 400, 600, 800, 1000, 1200, 1400, 1600, 2000, 4000 ]
},
The app demonstrates the usage of the Kentico.AspNetCore.LocalizedRouting
NuGet package for localizing URLs for SEO purposes.
Check out the contributing page to see the best places to file issues, start discussions, and begin contributing.