Tree based navigation vs navigation content type

2025/04/01 1:18 PM

Is creating navigation items cotnent type the best way to make a menu in Xperience? in 13 I was able to use the TreeNode to get everything and make my menus that way.


Environment

  • Xperience by Kentico version: [30.3.1]
  • .NET version: [8]

Answers

2025/04/01 1:24 PM

Check the docs out for more information on best practices here. They will give you a very good jump start on how to model and set navigation up in XbyK.

https://docs.kentico.com/tutorial/developer-tutorial/model-navigation

https://docs.kentico.com/tutorial/developer-tutorial/implement-navigation

2025/04/01 4:34 PM

That's what I had looked at previously. So, the best way to set up a site in XbyK is with the navigation its own content type, you can't just derive a menu from the structure of the content?

2025/04/01 7:13 PM

you can't just derive a menu from the structure of the content?

Correct. Navigation is content and we encourage customers to treat it that way. In previous versions of Kentico the "page as navigation" feature worked ok for small sites without good content modeling and was originally designed when mega menus were extremely popular.

Eventually they would grow in complexity and developers would use a variety of workarounds to make exceptions to the rule and break out of the constraints of the page tree matching the navigation. Examples include external links in navigation, flattening navigation, changing navigation to match marketing/content strategy.

Additionally, treating pages as navigation has a negative impact on caching. If you save a page that is in the navigation you have to clear the cache for the entire website because the navigation appears on every page. By treating navigation as its own content you only need to clear cache for the entire site when you modify navigation content items.

To answer this question, you have to login first.