Contents
What does it mean to render JavaScript in Sitecore?
JSS allows creation of individual JavaScript renderings in Sitecore that will be rendered during MVC page execution, similar to a controller rendering or view rendering except rendered using JavaScript (Node.js). The JavaScript rendering definition asks you to specify a JavaScript module (CommonJS module) and an exported function within the module.
How is content stored in the Sitecore database?
Sitecore is following the common best practice of storing content close to its native format. I.e. texts are stored as plain text in the database etc. Content is then encoded at render time, matching the output format. So if you render a text field on a page it becomes html encoded, if you pass it on to a Url, you URI encode it and so on.
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.
When to use read only display name in Sitecore?
The Sitecore.Data.Items.Item class has a convenience read-only DisplayName property that returns the content of the __Display name field, if set, otherwise it fallbacks on the item Name. This principle is used basically everywhere in Sitecore. It’s used when rendering the item tree, as link text on rendered links and so on.
How to use Sitecore layout service static context rendering?
This technique essentially involves composing your page from multiple Sitecore layout definitions – a layout for your header from a static item, a layout for your content from the current route item, and a layout for your footer from another static item. So why would you want this? In a word, personalization.
Is the renderstaticitemprocessor class enabled in JSS?
JSS comes with a RenderStaticItemProcessor class which is not enabled by default that allows the injection of static layout. To use it, there are a number of steps that need to be completed. Note that this guide is written from a Sitecore-first perspective. To get started, you need an item to render the layout of.