SaaS CMS BasePage Type
In PaaS, we could create a base page type, and then actual pages inherit from this, ensuring all pages have the same base set of fields. This is very convenient for several reasons:
When creating a new page type, I only need to define the fields that are unique to the page type
If I want to perform some action that looks at all pages, I have a hard time. I have to explicitly call out each page type for my graph query, and I cannot perform any query type actions like filtering based on fields that are custom to a page type.
For example:
I want to add a check box to all pages called "Exclude From Search". Then I want to create a my site search query. To get all pages I query on type _Page. But I cannot filter for this "Exclude From Search" field on the type _Page.
It would be great to add fields right to _Page, or some other intermediary type, that I can query.
-
There's a new feature coming to CMS SaaS called "Content Type Contracts". This features enables you to create content types acting as interfaces in C# and then apply these contracts to content types. This means that you can create instances of it but you can use it for querying to retrieve content of different concrete content types.
Contracts will get indexed to Graph where you can use them in you query and add where statements for all properties defined on the contract. You can either return the items result as the contract or use the GraphQL spread operator to return the items as their concrete types.
You can expect to see this feature in CMS SaaS in one of the upcoming releases.