3

I'm pulling a list of pages from a PublishingWeb like so

...
PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb(elevatedWeb);

foreach (PublishingPage page in pubWeb.GetPublishingPages())
{
    ...
}
...

By using a PublishingPage I can get the page Title, Description, CreatedDate easily but it sorts on CreatedDate ascending (I need descending, but would ultimately prefer using the default view to determine order)

Is there anyway to pull the DefaultView of the PublishingPages? I realize these are two different things since Views relate to an SPList and not a PublishingPage.

I can pull in the list instead with something like

SPList pages = web.Lists["Pages"];

foreach (SPListItem page in pages.GetItems(pages.DefaultView))
{
    ...
}

However, in this case the Title and CreatedDate fields are empty, if I dig deeper in the properties I can get to vti_title but feels like I've lost my way digging that far.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.