On one of our current project we have a close deadline, therefore we need to simplify implementation and cut from the scope as much as possible to roll out the MVP with the full functionality but without Experience Editor support – as it’s not priority for now. We had a long discussion about this, the main reason of cutting scope is to keep the frontend simple as possible and focus on business logic functionality instead of editing experience. Therefore on the Sitecore side we are providing a few APIs for the frontend and not creating any layout, rendering and placeholders; only pure templates and content.
Continue reading “Sitecore Headless – How to reuse Layout Service serialization in custom API Controllers”Tag: contents resolver
Sitecore Headless – Demystifying item serializers
In my previous posts I showed how you can extend the Layout Service and implement your own custom Contents Resolvers. Until now I simply wanted to serialize all non-standard Sitecore fields with its values. Although there could be a case where you need to include or exclude fields from the Layout Service response.
Continue reading “Sitecore Headless – Demystifying item serializers”Sitecore Headless Next.js – Forwarding custom query parameters to Layout Service
A few weeks ago the following question came up by Robbert Hock on Sitecore Chat:
Contents Resolver question: with
Robbert HockContext.HttpContext.Request.Params["item"]
I can read the url of the item. But when for example we have a url like/news?page=1
, how would I read the page querystring prop in a contents resolver? Somehow I can’t find it, since the request is like/sitecore/api/layout/render/default
This is a fair question, if you would like to process custom parameters in your custom Contents Resolver.
Continue reading “Sitecore Headless Next.js – Forwarding custom query parameters to Layout Service”Sitecore Headless – Wildcard item with datasource content resolver
On one of my first Sitecore Headless project I got a requirement to implement a dynamic URL resolving to display product data from a different root of the Sitecore tree. If it would have been a traditional Sitecore solution I could implement a custom item resolver but in the headless world we need a different kind of mindset to solve problems like this.
Continue reading “Sitecore Headless – Wildcard item with datasource content resolver”Discovering Sitecore ASP .NET Core SDK – Datasource Item Children Resolver
TL;DR
namespace Discovering.Sitecore10.Models | |
{ | |
public class ChildrenBlockModel | |
{ | |
[SitecoreComponentField(Name = "items")] | |
public IEnumerable<ItemLinkField<ContentBlockModel>> Children { get; set; } | |
} | |
public class ContentBlockModel | |
{ | |
[SitecoreComponentField] | |
public TextField Title { get; set; } | |
} | |
} |
Longer interpretation
I wanted to play around a bit with different Contents Resolvers. The default resolvers are the following under the /sitecore/system/Modules/Layout Service/Rendering Contents Resolvers
item:
- Context Item Children Resolver
- Context Item Resolver
- Datasource Item Children Resolver
- Datasource Resolver
- Folder Filter Resolver
- Sitecore Forms Resolver