// Create criteria collection
var criterias = new PropertyCriteriaCollection
{
// Find pages of a specific page type
new PropertyCriteria()
{
Name = "PageTypeID",
Condition = CompareCondition.Equal,
Required = true,
Type = PropertyDataType.PageType,
Value = "5" // Page type ID = 5
},
// Exclude pages directly under a certain page
new PropertyCriteria()
{
Name = "PageParentLink",
Condition = CompareCondition.NotEqual,
Required = true,
Type = PropertyDataType.PageReference,
Value = "100" // Page ID = 100
},
// Find pages from this year only
new PropertyCriteria()
{
Name = "PageStartPublish",
Condition = CompareCondition.GreaterThan,
Required = true,
Type = PropertyDataType.Date,
Value = new DateTime(DateTime.Now.Year,1,1).ToString() // After January 1st
}
};
// Search pages under the start page
var pages = DataFactory.Instance.FindPagesWithCriteria(
PageReference.StartPage,
criterias);