Coder Social home page Coder Social logo

kontent-mvc-navigation's Introduction

kontent-mvc-navigation

⚠️ This README is under construction. ⚠️

This application serves as a supporting repository for a blog post series showing how to build a dynamic navigation menu using .NET Core MVC and the Kentico Kontent headless CMS. The project is broken up across different branches ("Parts") to showcase code changes throughout the different blog posts.

📰 links to the related blog post will be included when published.

Application setup

Running the application

To run the app:

  1. Clone the app repository with your favorite GIT client
    1. For instance, you can use Visual Studio, Visual Studio Code, GitHub Desktop, etc.
    2. Alternatively, you can download the repo as a ZIP file, however, this will not adapt line endings in downloaded files to your platform (Windows, Unix).
  2. Open the solution in Visual Studio.

Importing the blog post project

To import the sample project:

  1. Go to app.kontent.ai and create an empty project

  2. Go to Project Settings > Localization

    • Edit "Default Language" to be:
      • Language name: English (United States)
      • Codename: en-US
    • Create new language:
      • Language name: Spanish (Spain)
      • Codename: es-ES
  3. Go to Project Settings > API Keys, note the Project ID and Management API keys for later use

  4. Install the Kontent Backup Manager and import data to newly created project from the part_four_backup.zip file (place appropriate values for apiKey and projectId arguments):

    npm i -g @kentico/kontent-backup-manager
    
    kbm --action=restore --apiKey=<Management API key> --projectId=<Project ID> --zipFilename=part_four_backup

    Alternatively, you can use the Template Manager UI for importing the content.
    Note: All language variants in the Kentico Kontent project must be published. The Kontent Backup Manager does this by default, and there is a "Publish language variants after import" option in the Kontent Template Manager UI.

Connecting to the sample project

Perform the following steps to connect your MVC application to the imported project:

  1. In Kentico Kontent, choose Project settings from the app menu.

  2. Under Production Environment Settings, choose API keys and copy the Project ID.

  3. Open the appsettings.json file.

  4. Use the values from your Kentico Kontent project in the appsettings.json file:

    • Project ID: Insert your project ID into the ProjectId application setting.
    {
    "DeliveryOptions": {
      "ProjectId": "<your Kontent project ID>"
    },
  }

Web Spotlight

Note: The showcased navigation can be setup without Web Spotlight by manually creating the Homepage and Page content types.

Web Spotlight is used throughout the blog series and dictates the structure of the navigation menu. It is an additional (optional) tool for Kentico Kontent focused on website management. For this project, it allows for:

  • Seeing the hierarchy of the navigation in a page tree
  • Creating new pages from the page tree
  • Previewing changes in the Kontent UI

Web Spotlight is a paid feature and must be activated by a member of the Kentico Kontent Sales team for your subscription before it can be used. More information about Web Spotlight and activation can be seen in the official Kentico Kontent documentation.

Web Spotlight uses Kentico Kontent's "Preview" functionality in order to show the live view of the site within the UI.

To set up preview URLs for your project:

  1. In Kentico Kontent, choose Project settings from the app menu.
  2. Under Environment settings, choose Preview URLs.
  3. Type in the preview URLs for each type of preview-able content.

More details about setting up preview and Web Spotlight can be seen in the official Kentico Kontent documentation.

Note: Preview URLs require an https:// protocol and a URL accessible to Kontent. Without a valid SSL certificate, Kontent responds with secure connection errors. When developing apps locally, see how to serve pages over HTTPS in combination with ngrok's forwarded address.

Localization

This application uses route localization and tag helpers provided by the AspNetCore.Mvc.Routing.Localization package.

kontent-mvc-navigation's People

Contributors

kentico-michaelb avatar petrsvihlik avatar

Watchers

James Cloos avatar  avatar

kontent-mvc-navigation's Issues

Missing guidance on setting up the content model

hey Mike, I wanted to give it a go today but...how can I test it? there is no information regarding setting up the content model nor an export from the backup manager...I could check the code but I'd like to see it in action first.

(or you could share your project id at least :))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.