John Lieb-Bauman
John Lieb-Bauman

Reputation: 1436

Piranha CMS existing models and Piranha Menu

I cannot seem to figure out how to add my preexisting pages to the auto navigation menu that Piranha generates when I call @UI.Menu().

Currently, I am using the method described here under Getting the Models to pull CMS content and display it above my model data. I can successfully render the page with Piranha content, but I'm not sure how I can have this page display in the top navigation.

Alternatively, I can pull my data and display the CMS content by creating a new page type, but this means the page type is only ever used to display this single page. It shows up in the navigation generated by @UI.Menu(), but if I continue using this method, I would need to create an additional piranha controller for every Action.

My main objective is adding CMS functionality to my custom MVC project and have everything display in an automatically generated navigation with @UI.Menu().

Upvotes: 0

Views: 1338

Answers (1)

Håkan Edling
Håkan Edling

Reputation: 2753

If you want to add pages in the menu that aren't really controlled by the CMS add a single page type for them, for example "Application Page". Then check the documentation for page types under section 2.5 here http://piranhacms.org/docs/pages/page-types.

If you check the checkbox to allow pages to change the route you can specify the route on each page of this page type. This means you can add your application pages into the structure and the add the route to your controller/action.

Upvotes: 1

Related Questions