Configure the Sitecore Layout Service to output HTML for MVC renderings
You can configure the Layout Service to output HTML instead of JSON to use it for scenarios such as statically rendering MVC applications with JSS.
To configure the Layout Service to output HTML for MVC renderings:
-
Navigate to sitecore/layout/Renderings and enable HTML output for the renderings using one of the following methods:
-
For the relevant renderings, to enable HTML output manually, select the Render as HTML check box. You must enable this option for all nested renderings as well.
TipTo identify the components requiring this setting, look in the JSON output for the
componentNameproperty. ThecomponentNamematches the rendering item name.
-
If you have Sitecore PowerShell Extensions installed, run the following script in the Sitecore PowerShell ISE tool, to select the Render as HTML check box for all renderings:
NoteTo run the script, you must have Sitecore PowerShell Extensions installed.
-
Use a global configuration to disable JSON rendering and switch to HTML serialization for all renderings:
-
-
Publish your changes.
-
Refresh the Layout Service endpoint and verify that the component data output is in HTML.