List unpublished children

Vote:
 

Hi! It seems that GetChildren() in IContentRepository only returns published pages. How do I get a list of all children, including the unpublished ones?

Regards Christer

#87592
Jun 17, 2014 15:58
Vote:
 
try this
 var pages = DataFactory.Instance.GetChildren(CurrentPage.PageLink, LanguageSelector.AutoDetect(true));
#87595
Jun 17, 2014 17:01
Vote:
 

I find it odd but maybe there is a reason for this that in ordered to get unpublished pages, you have to pass in a language.  This is right K Khan but you would think and overload for Publish status or booleaon for get children would accept the following.  I have always been baffled by this but I am not the dev but have found it curious.

#87600
Jun 17, 2014 18:57
Vote:
 

Thanks! Adding a languageselector to GetChildren() returns all the pages. Weird...

#87631
Jun 18, 2014 13:34
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.