1

We are trying to use Sitecore Layout service to get Sitecore content in JSON format. Is it possible to add additional parameter which we can read and use to customize the Layout service output?

Thanks in advanced.

1

1 Answer 1

0

You can customize your Layout Service by extending the class JssGetLayoutServiceContextProcessor provided by Headless Services.

You can override the following method:

protected override void DoProcess(GetLayoutServiceContextArgs args, AppConfiguration application)

Inside this method, you can use below code to ready the query string:

string queryStringValue = HttpContext.Current.Request.Url.Query["query_string"];

You can use queryStringValue in your business need.

Hoping it will help you.

https://doc.sitecore.com/xp/en/developers/hd/190/sitecore-headless-development/extend-the-getlayoutservicecontext-pipeline.html

Thanks.

1
  • Thanks for the response. I will check and update the answer Feb 2, 2022 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.