Hi,
By using the the method GetDescendents() you will get the details of all subpages or say child pages. and you can the required attributes or id whatever you want to use.
Example:
public static List<T> GetDescendentsOfType<T>(this DataFactory dataFactory, PageReference pageLink)
{
var listOfPages = dataFactory.GetDescendents(pageLink);
var pageData = new PageDataCollection();
foreach (var reference in listOfPages)
{
var page = dataFactory.GetPage(reference);
var id=page.PageTypeId;<b></b>
if (page is T)
pageData.Add(page);
}
return pageData.Cast<T>().ToList();
}