5
votes
Accepted
Cannot query field \"search\" on type \"Query\"
The App_Config\Sitecore\Services.GraphQL\Sitecore.Services.GraphQL.Content.config is from the JSS package, no need the change there somethings.
It is about your GraphQL endpoint, In your end point ...
4
votes
JSS layout service, how to restrict public access
Well you can't.
The one mechanism that could lock that service down with something that could not just be picked up on the network tab and restrict access to the service to only those people you ...
3
votes
How do you render Headless ASP.NET to present a Sitecore page as 404?
You can use:
return Redirect("/ErrorPages/404");
or
return Redirect("http://myErrorPage");
instead of:
return View("NotFound", request.Response.Content.Sitecore.Context);
...
3
votes
Accepted
Prevent Sitecore from creating the sitename#lang cookie in jss/nextjs app
Here is an example of how you can create a custom processor to remove the lang cookie for Layout Service requests:
Create a new class that inherits from JssGetLayoutServiceContextProcessor.
Override ...
3
votes
Accepted
How to add a custom header in every JSS layout service request in Node JS reverse proxy solution template
This is doable in Node JS reverse proxy template.
Go to \src\config.ts
Under the ProxyConfig => proxyOptions. Basically, this is http-proxy-middleware, so you can customize it like here.
Add the ...
3
votes
Accepted
ProcessItem when extending JssGetLayoutServiceContextProcessor
Since you are extending the JssGetLayoutServiceContextProcessor, you will not have access to the ProcessItems method from the RenderingContentsResolver.
One thing you can do is to implement it within ...
3
votes
Accepted
When JSS component is hidden via personalization Experience Editor show warning about missing "Hidden Rendering" implementation
To fix the issue you need to implement React component for this rendering. The problem is that layout service returns it with space in name, so your componentFactory.js should have following generated ...
3
votes
Accepted
Why JSS Layout Service default resolver differently resolves reference fields of the same item, leaving some with the reference item context or ID?
This looks similar to the issue we had in our solution which was identified as a bug in Layout Service and fixed for us by Sitecore Support in both 9.3 and 10.0.
You can check it with Sitecore Support ...
3
votes
Accepted
How to get ContentBlockModel/Component Model from PageModel directly using asp.net core rendering sdk
Once you get a Component from the Placeholder, you can use the ReadFields<T>() method or other Read methods to get strongly-typed values from it. Keep in mind that this is just JSON ...
2
votes
Accepted
Relative item path in layout service call is not working
We have discussed the issue in a private chat and figured out, that the /CustomHome item are placed on the same level with a site start item which makes it impossible to resolved by relative path. In ...
2
votes
Using Layout Service with master db
JSS Layout Service take a database based on the current site which is resolved by a domain name in your URL. Your site, that stays behind jssapp domain, is configured to use the web database. Update ...
2
votes
Accepted
Sitecore.LayoutService.dll version mismatch between NuGet and Headless Services package
I agree NuGet Packages for Layout Services are confusing here. But You need to use sc-packages - Sitecore.LayoutService 7.1.0 here.
PM> Install-Package Sitecore.LayoutService -Version 7.1.0 -Source ...
2
votes
Accepted
Why is JSS rendering items of template Sample Item but not of any other template?
Following some testing locally, the reason you may be getting an Error 404 is when there is no layout set on the item.
So, my test cases were as follows:
1st Test Case
Create an template without any ...
2
votes
Accepted
How to get 404 status code on Rendering host
When a new Next.js app is create a default 404 Page file is created.
This file is statically generated at build time.
import NotFound from 'src/NotFound';
const Custom404 = (): JSX.Element => <...
2
votes
How do you render Headless ASP.NET to present a Sitecore page as 404?
We have implemented it as a custom Pipeline with Sitecore JSS therefore it will work also with ASP.NET Headless. Of course in integrated mode. In headless mode you need to approach this with different ...
2
votes
Layout Service performance optimisation
Few ideas for troubleshooting. They are not really related to JSS, but still worth trying:
Where are the servers located? When providing TTFB values are these from a region nearby? E.g. you are ...
1
vote
GraphQL Component Query does not effect Layout Service response
Had the same issue and found another solution (to what probably is a bug - still working with Sitecore support on that). Based on what Chet already found I checked my config and noticed I had 2 ...
1
vote
GraphQL Component Query does not effect Layout Service response
Workaround
The expectation is that the GraphQLAwareRenderingContentsResolver should be the default for any Json Renderings.
With that said, I've identified a workaround that might help others with the ...
1
vote
Layout Service returns 404 on CD Servers for Sitecore 10.2 XM
This is likely caused by one of two issues:
The API key is incorrectly configured (less likely given the symptoms)
The Headless Services package is missing required configuration on the CD role. (...
1
vote
Extending LayoutService RenderingContentsResolver class to configure default LayoutService response
First potential issue:
It looks like you're creating an entirely new config called "jss-rendering". Was this intentional, and did you set up your site to use this config?
If using JSS+SXA ...
1
vote
Accepted
How to add a new property in the route object of the JSS Layout Service?
I have performed an investigation on how Sitecore adds the values to the route. As of now, I've found 2 ways of adding custom data to the route node:
Extend the GetJsLayoutRenderer and override the ...
1
vote
Skip standard fields in GraphQL query results without strongly-typed items
Without a sample query reference to tailor my answer, I think what you could leverage here are query fragments to help with multiple templates.
For example:
fragment itemDetails on Item {
id
name
...
1
vote
Asp.Net Model binding is not working for any node that is under "placeholders" using Sitecore ASP.NET Rendering SDK
If you are talking about the OOTB code, you can see index.cshtml. Here the name of the placeholder is jss-main.
You should be adding the placeholder Settings with the same name on the Sitecore page ...
1
vote
Accepted
Adding a list of objects to Context Data returned by Layout Service
This can be done in following way.
protected override void DoProcess(GetLayoutServiceContextArgs args, AppConfiguration application)
{
args.ContextData.Add("items", new[]
{
...
1
vote
Layout Service Sending Sitecore Item Name instead of Component Name
So I've updated JSS to 15.0.1 and it fixes the componentName issue. It seems there's a bug in Sitecore 10 and Jss that was fixed in 15.0.1. Strange that it wasn't mentioned anywhere in the release ...
1
vote
JSS Layout Service fails an item resolving by path with virtual directory
Layout Service can not resolve a virtual directory by default. Sitecore recommends to always populate sc_site parameter in the calls to Layout Service to use this technique. But, if you have more than ...
1
vote
Accepted
Method not found: 'Sitecore.JavaScriptServices.ViewEngine.Pipelines.GetRenderEngineFactory.GetRenderEngineFactoryArgs.get_RenderEngineType()
You appear to have an inconsistent JSS installation. Ensure all Sitecore.JavaScriptServices assemblies are of the same version. If you are referencing JSS assemblies via NuGet, ensure you are ...
1
vote
How tracking works for Layout service used for Mobile apps (API-Only Mode)?
As mentioned, Sitecore's session tracking is cookie-based, so for native/mobile apps you will need to use a HTTP client that is capable of storing cookies. For instance, if using React Native, it has ...
1
vote
How tracking works for Layout service used for Mobile apps (API-Only Mode)?
The Layout Service executes within the Sitecore MVC rendering engine, and thus retains all Sitecore analytics tracking and functionality. So if you use the Layout Service for routing in your JSS app, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
layout-service × 44jss × 38
graphql × 4
personalization × 3
nextjs × 3
sxa × 2
sitecore-api × 2
rendering-host × 2
experience-editor × 1
sitecore-forms × 1
security × 1
login × 1
tracking × 1
buckets × 1
user-profile × 1
sxa-search × 1
nuget × 1
seo × 1
cookies × 1
renderfield × 1
json × 1
api × 1
typescript × 1
sxa-jss × 1
jss-rendering-sdk × 1