Custom Kentico Navigation Menu for MVC project

adib salhani asked on February 8, 2017 06:23

Dear,

We are implementing our project by using Kentico 10 as a back-end, and MVC 5 as Front-end. We configured the project as per Kentico advice in this article. We created the structure in the back-end with the help of page types and pages in the front-end, we used Kentico API to communicate with back-end and retrieve data.

We are now on the face of building site menu. The menu should always reflect the structure created in Kentico. Moreover, the admin user should have the ability to hide (no delete) a node from being rendered in menu. Therefore, I would like to ask you: - What is the best way to read structure displayed in Pages module by my code? - How should I put the custom configuration I want to add?

I really appreciate your kind replay.

Recent Answers


Dragoljub Ilic answered on February 8, 2017 12:24 (last edited on January 23, 2018 16:14)

Hi Adib,

I faced with same issue like you, but I couldn't find any best practice for that. You can implement it by adding custom field on page type 'include in header'. In MVC project you can create Master controller and trigger it from Layout like @Html.Action("Navigation", "Master"). In that action you can retrive all data from kentico that you need to show (like pages where 'include in header' is checked). As performance improvement, you can cache all data that you retrieve from kentico.

1 votesVote for this answer Mark as a Correct answer

Bill Tran answered on February 8, 2017 16:06 (last edited on February 8, 2017 16:07)

0 votesVote for this answer Mark as a Correct answer

Brandon Prudent answered on January 26, 2018 01:20

So, the Pages segment is useless in this case? Is there no recommended solution to this? I didn't find the "best practices" link helpful as it doesn't seem to include a solution for MVC.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.