What i need is a list of all pages on the website, something like: Home, Page1, Page2, Page3 ... and so on. I know i can get there with xslt but I'm starting to learn the umbraco API and got confused here.
On umbraco TV we have some sample code/video like this:
Dim curPage As Node = Node.GetCurrent For Each nd In curPage.Children ' do somehint here Next
The code above will list pages under the current page right? So, how can i list all pages, is there something like "Node.GetAll"?
There is an umbraco.library function call GetXMLAll() which returns all the xml from the cache. The value returned is xpathnodeiterator so you can loop through the content nodes.
Retrieving all pages from code behind
Hi;
What i need is a list of all pages on the website, something like:
Home, Page1, Page2, Page3 ... and so on.
I know i can get there with xslt but I'm starting to learn the umbraco API and got confused here.
On umbraco TV we have some sample code/video like this:
Dim curPage As Node = Node.GetCurrent
For Each nd In curPage.Children
' do somehint here
Next
The code above will list pages under the current page right? So, how can i list all pages, is there something like "Node.GetAll"?
You can use Node root = new Node(-1) as far as I know...
-1 is the root (content) node if I remember correctly, then you can get children and the children's children and so on...
There is an umbraco.library function call GetXMLAll() which returns all the xml from the cache. The value returned is xpathnodeiterator so you can loop through the content nodes.
http://our.umbraco.org/wiki/reference/umbracolibrary/getxmlall
-Chris
is working on a reply...