Fetch all pages

Vote:
 
I need to create a selectbox populated with all pages. How can I get hold of the entire tree structure?
#12410
Mar 25, 2008 18:34
Vote:
 
You can use the PageTreeLoader PageTreeLoader ptl = new PageTreeLoader(); ptl.GetCompletePageTree(PageReference, Global.EPDataFactory)
#14219
Mar 25, 2008 18:44
Vote:
 
Thanks, Solves my problem
#14220
Mar 25, 2008 18:44
Vote:
 
Just beware that this will kill performance if the site has many pages. /Steve
#14221
Mar 25, 2008 18:44
Vote:
 
Is there a better way to do it?
#14222
Mar 25, 2008 18:44
Vote:
 
Not if you actually need all pages in your box (not sure what you mean by selectbox). If you've got a large site, displaying all pages at the same time will be rather hard to use for the visitor. So, not knowing exactly what you want to achieve, I cannot see a better way of doing this. Steve
#14223
Mar 25, 2008 18:44
Vote:
 
Use EPiServer.WebControls.InputPageReference if you need the user to select 1 page. /Håkan
#14224
Mar 25, 2008 18:44
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.