0
votes

I'm trying to make a webpart which shows all pages of current site.

To represent it I need just Title, Description and URL of page.

I have figured out that every page is in "Pages" list, but there are no such data as Title etc.

Do you have any solution for getting Pages data in SP 2007?

1

1 Answers

0
votes

To get the pages data, you just query the pages library (I assume you have a field named Description in the library).

var query = new SPQuery();
var list = SPContext.Current.Web.Lists["Pages"];
var items = list.GetItems(query);
foreach (var item in items)
{
    string title = item["Title"] as string;
    string url = item.Url;
    string description = item["Description"] as string;
}