Page extenders

One powerful feature is to use additional page extenders. This is a usefull way to provide pages with data that comes from a source outside of the CMS, for instance a product database.

It's implemented by extending your page type definition with the IPageExtender interface. By doing so you're telling the system that URLs that go beyond the path of the page using that particular page type will be handled by the page.

Let's say you have want a product page that will display products that isn't stored in the CMS you create a new page type that implements the IPageExtender interface. This page will act as a start page for your additional listing, in the case of this example we will use it to list which products are available.

For instance we create a page that gets the URL /products/. If we navigate to this page it will act like any other page in the system. The difference is that we now can navigate to /products/any/extended/path/we/want/ and it will be treated like a valid URL (unless we decide that the posted extra path doesn't represent any content and in that case it will be treated as any invalid address). The extended path will be passed to our product page type and we can confirm or deny if it's a proper path and redirect to the correct presentation of the external page.

In our case we might want to use unique product ids in order to extend the web site with product pages. When a call is made to /products/my-product-id-1234/ the page type gets called with the extend path, in this case "my-product-id-1234". First action to make is to validate that the value from the path is a valid product. If it isn't we'll return a false-value and the user is faced with a missing page message (as with any other request for non existing pages), otherwise we'll redirect to another template that has been made to present the product.