Contents
Can a JSS app be placed in a Sitecore rendering?
It is important to understand that JS renderings are an alternate programming model from a JSS app. You cannot use JS renderings to place a regular JSS app within a Sitecore MVC rendering. This is because a JSS app is larger, full-layout-controlling app.
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.
How to scaffold new JSS components in Sitecore?
All JSS does is inject the content data from Sitecore. JSS’ sample apps include a script that allows you to easily scaffold new JSS components. The script is run like so: This script is a completely customizable boilerplate ( /scripts/scaffold-component.js) if you don’t like the default scaffolding conventions.
How to embed JavaScript in a Sitecore MVC site?
This is a technique to allow JavaScript contents to render into a rendering added to a traditional Sitecore MVC page. Doing this allows embedding a JavaScript app within an existing Sitecore MVC site, as opposed to as its own standalone JSS site. This technique executes server-side rendering of the app and returns the rendered markup.
How are JavaScript renderings different from client side embedding?
Compared to Client-Side Embedding, JavaScript Renderings have a different scope. With client embedding, a JSS app is embedded into a Sitecore MVC rendering, and rendered on the browser.
How to define a rendering function in JavaScript?
The JavaScript rendering definition asks you to specify a JavaScript module (CommonJS module) and an exported function within the module. For example, you might enter /dist/jsrenderings/server.bundle.js and renderComponent respectively.
What does the output of the render method do?
The Rendering Data output displays the format of the data passed as the data argument of the render method in the code. The Viewbag output displays the data as the viewBag argument of the render method.
Why is development mode not publishable in JSS?
By default the Development Mode workflow state is not publishable. This means that a JSS site that has its content database set to anything other than master (thus enabling workflow and publishing) will not publish content items that are imported from the JSS app manifest without workflow approval.
How does the content workflow work in JSS?
To further facilitate this, JSS includes a content workflow which is automatically applied to all generated templates. This workflow defines Development Mode and Content Mode states to designate the current “ownership” of a content item. Import can overwrite field values and route item layout.