Umbraco Content Delivery API – Compose layout from multiple sources

One of the generic requirements for a website is to able easily create new pages without adding the common components (such as footer, header, navigation, search bar, etc.) to all newly created pages manually. My idea is to compose the final page layout response from multiple Umbraco items using Block Grid Editor. In my simple example I would like to add the header and footer components from a shared node to all pages. First, let’s build up the following item structure in Umbraco.

Continue reading “Umbraco Content Delivery API – Compose layout from multiple sources”

Umbraco Content Delivery API – Extending the API response with extra fields

The default Content Delivery API implementation and features can be found in different API endpoints. These controllers are using services, builders, etc. which are in a deeper a layer in the architecture and therefore controllers are re-using these functions. When I started to explore how to extend the default API responses, the most obvious extension points are the controllers – just inherit from the original controller and create a new one with the extension. In my opinion, this is not the best way because we need to touch all the controllers in this case and publish our own endpoints next to the original endpoints.

Continue reading “Umbraco Content Delivery API – Extending the API response with extra fields”