Can someone help me to know how to get the Nodes list form n

Posted by lyoid.lopes@merrithew.com on 25-Nov-2019 22:40

I am trying to get the list of Nodes from NavigationModel 

public IList<NodeViewModel> RenderMenuItems()
{

NavigationModel model = new NavigationModel();
IList<NodeViewModel> nodes = model.Nodes;
return Ok(nodes);
}

But the count is always 0

How can I get the nodes list for Navigation. I see there is an Interface to access the nodes list 

Telerik.Sitefinity.Frontend.Navigation.Mvc.Models.INavigationModel

Can you please provide me with some guidance on how to get the nodes list

All Replies

Posted by jread on 03-Dec-2019 14:51

Hey [mention:4afcf2ef604445999ba1e989f6fc7a9f:e9ed411860ed4f2ba0265705b8793d05] ,

Thanks for the question but I am not sure there is enough context here for us to assist you ... In short what are you trying to accomplish and where are you trying to do it?  There is also the clientside restful API that returns the list of pages in JSON if you are trying to just get the list.  http://{yourdomain}/api/default/pages (the defualt is restricted to admin by default) so adjust the security as needed.  If you are trying to override the navigation widget Model, here is a link that onlines the process of extending the navigation widget view model to expose more properties to the view (custom fields from a page). www.progress.com/.../extend-the-model-of-built-in-widgets-mvc

This thread is closed