Developer Forum »
GetContents - regardless of node state
3 posts

Hi!

I have created a custom module in webnodes where I want to show all nodes of a spesific type. Using "WAFContext.Session.GetContents<MyType>()" i get all the published nodes of this type. But I also want to return nodes that are unpublished, soft deleted and nodes that have exceeded the retain date, regardless of whether they are published or not.

How can I achieve this?

3 posts
181 posts

Hi!   Use this as a startingpoint:  

AqlQuery q = WAFContext.Session.CreateQuery();
AqlAliasArticleBase aliasArticle = new AqlAliasArticleBase();
aliasArticle.IncludeUnpublished = true;
aliasArticle.IncludeDeletedNodes = true;
aliasArticle.IncludeHiddenNodes = true;
q.From(aliasArticle);
q.Select(aliasArticle);
AqlResultSet rs = q.Execute();
while (rs.Read()) { 
   //do your thing!
}

   

3 posts

Seems to work perfectly! Thank you!

1