Reading Pages Under a Site
Use the foll code snippet to read the pages under a site (Postings under a channel in CMS 2002 terminology):
if (PublishingWeb.IsPublishingWeb(web)){
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
// Postings under this Channels
PublishingPageCollection pages = publishingWeb.GetPublishingPages();
foreach (PublishingPage page in pages)
{
//page.Name
//page.Title;
//page.Url;
}
}
if (PublishingWeb.IsPublishingWeb(web)){
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
// Postings under this Channels
PublishingPageCollection pages = publishingWeb.GetPublishingPages();
foreach (PublishingPage page in pages)
{
//page.Name
//page.Title;
//page.Url;
}
}
Comments