I am not sure if this is a normal behavior or not.
Basically I am retrieving a list of top level pages via code using something like:
var topLevelPages = manager
.Where(p => p.Parent.Title == "Pages")
.OrderBy(o => o.Ordinal);
The problem in not in the code but on the recycle bin.
I had a list of pages on the CMS market "show in the menu". The snippet above (with an if statement) is picking everything fine.
I deleted a top level page (was a group page) and I could still see the page listed. (The code was still picking the page even though I delete it).
In order to completely remove the page from being displayed I had to remove it from the bin.
I suppose the code should not picks up things from the bin?
Hope this makes sense
var pageNodes = App.WorkWith()
.Where(pN => (pN.Page !=
&& pN.Page.Status == ContentLifecycleStatus.Live && pN.Page.Visible ==
Can you please explain the difference between
pN.Page.Status == ContentLifecycleStatus.Live
My understanding is that if something is "ContentLifecycleStatus.Live" then it can't be in the Recycle Bin. Am I incorrect in my understanding of the Recycle Bin?
I've experienced similar issues when querying images, previous widgets I've created used:
HomepageSliderRepeater.DataSource = album.Images().Where(i => ContentLifecycleStatus.Live).OrderBy(i => i.Ordinal);
Which then had to be changed to:
HomepageSliderRepeater.DataSource = album.Images().Where(i => i.Status == ContentLifecycleStatus.Live).OrderBy(i => i.Ordinal);
Is this adjustment required for all widgets which query content types that can be placed in the Recycle Bin?
PageManager pageManager = PageManager.GetManager();
IQueryable<PageData> pages = pageManager.GetPageDataList().Where(pData => pData.IsDeleted ==
&& pData.Status == ContentLifecycleStatus.Live);