Views: 1155
Number of votes: 2
Average rating:

Only find pages those hold data with no shortcut link to other pages, etc.

I had a requirement to find only pages those doesn't have shortcut link to another page or fetch data from another page etc means those pages holding the actual property data that needs to be manipulated.

When I couldn’t find quickly on how that can be done using property criteria using the FindPagesWithCriteria method, I stumbled on digging little bit into EPiServer.Core and found that the PageShourtcutType is of type enum which has the first option ‘Normal = 0’ which I need to look for.

When I debug the PageDataCollection before filtering with criteria, I noticed that the value stored is a number.

So my code snippet as below and it worked like a charm in the first instance.

new PropertyCriteria {
    Condition = CompareCondition.Equal,
    Type = PropertyDataType.Number,
    Name = "PageShortcutType",
    Value = "0",
    Required = true​

Jun 26, 2014

Please login to comment.