Querying for all pages that inherit from a base page type

mun yung kan asked on January 11, 2016 03:14

Hi Guys,

i'm trying to query for all pages that inherit from my "Site.BasePage" pagetype.

There are several pages already created in the content tree with page types that inherit from the basepage.

my query code is as follows

var children = DocumentHelper.GetDocuments("Site.BasePage")
                .Path(node.NodeAliasPath, PathTypeEnum.Children)
                .OrderBy("NodeOrder");

am i missing some parameters to enable the query from picking up the inheritence?

Correct Answer

Brenden Kehren answered on January 11, 2016 03:32

There's a column in the cms_class table called ClassInheritsFromClassID. One way or another you need to get that class ID based off of your parent class, then run your query with all those class names.

1 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.