Contents
How does the layout service work in Sitecore?
By using Sitecore MVC pipelines, the Layout Service output will account for any personalization rules and/or content testing in the item’s layout definition. Instead of rendering MVC views, a custom JS serializer will take component’s data source item (s) and will serialize them into a JS object.
Where are rendering contents resolvers located in Sitecore?
JSS allows you to configure a Rendering Contents Resolver on each rendering, which determines how a rendering and its associated data are serialized. Rendering Contents Resolvers are configured in /sitecore/system/Modules/Layout Service/Rendering Contents Resolvers.
Can a field name be changed in Sitecore?
Field names can be changed in Sitecore, if you need to e.g.: have them camel-cased, you need do it in Sitecore. So basically serialization configuration is responsible for changing JSON on which user don’t have influence. Changing the Layout Service configuration used by JSS should be done with care.
What should the rendering contents be in JSON?
By default, when serializing a rendering to JSON, the Layout Service will populate the rendering contents with the fields of the rendering’s datasource item. You may have occasions where you would like to output something else, such as: JSS and the Layout Service provide three options for customizing this output.
Where to find route data in Sitecore JSS?
The Placeholder component, and any components that it renders, expect route data to adhere to a specific schema – outlined in the Reference below. For disconnected development, route data is typically retrieved from static YAML or JSON files, or simple JavaScript files.
Where are the imported fields in Sitecore JSS?
By default, all the imported fields in a JSS app are placed in what Sitecore calls data sources. These are data items which are referenced in the layout of the route item. The route item itself does not contain any of its own fields by default. To add fields to an item, you need to do it on a data template.
How are JSS used in the layout service?
The jss portion of this route refers to a particular named configuration of the Layout Service. These can be used to create app-specific layout service extensions by registering your own. An item lookup is performed based on the item parameter which takes the context site’s start item into account.
Why do you need JSS for Sitecore?
Sitecore JavaScript Services (JSS) allows frontend developers to use modern UI frameworks (eg. React.js) without loosing access to the whole Sitecore Experience Plattform when implementing UI’s for Sitecore implementations. I had quite some problems when I first set up the Sitecore JavaScript Services.
Is the JavaScript layer of Sitecore open source?
The JavaScript layer of JSS is open-source. You can use the GitHub repository to submit issues, feature requests, and pull requests. See the contributing guide for guidelines. Assistance with the JSS products can also be obtained in community-based channels.