Site Menu (v2.0)

Kooboo provides some simple API methods to build the menu structure.

Define the Menu Tree



When you are defining a page, there are 4 fields related to menu.
Kooboo page menu setting
Nav Parent: The parent page on navigation tree.
Show In Menu: Appear on navigation tree or not
Navigation Text: Link Text, the page object also has a LinkText Property which will get the page name when navigation text is not available.
Navigation Order: Sort order

To make a page appear in the menu tree, "Show In Menu" must be checked.

Query the Menu


There are 4 main menu API method to query the menu. Those API will return one or more page objects, you can use Kooboo PageLink method to build the page link/menu.
Kooboo page menu api
GetTopPages: The root pages on navigation tree.
GetParentPage: Get the parent page object.
GetSubPages: Get sub page objects of current page.
GetSilbingPages: Get the pages in the same level.


Below is some sample code to build the menu tree based on menu API. There is also a menu module which can be used for similar purpose. In Kooboo 2.0, page.PageName has been replaced by page.VirtualPath. page.PageName will only valid when this page name is unique within the application.