1

Using the OTB sitecore installation, I wanted to JSS'ify the home node for testing purposes. By default this is setup with the following presentation details:

enter image description here

The steps I followed were to:

  1. Update the sample layout item to include main in the field Layout Service Placeholders
  2. Create a new placeholder settings item: centercolumn
  3. Update the Sample Sublayout item to include centercolumn in the field Layout Service Placeholders
  4. Added Sample Inner Sublayout as an allowed control in the placeholder settings item

The issue I find is that the layout service never includes the rendering information for the Sample Inner Sublayout. The placeholder json is always empty:

enter image description here

Why might this be?

5

By default, the jss named configuration for Layout Service uses the Sitecore.LayoutService.Placeholders.DynamicPlaceholdersResolver, so it expects placeholder keys to be dynamic.

If you're managing renderings via Content Editor / presentation details, you either need to manually construct dynamic placeholder keys (yuck, but possible), or in: App_Config/Sitecore/LayoutService/Sitecore.LayoutService.Jss.config

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <layoutService>
      <configurations>
        <config name="jss">
          <rendering type="Sitecore.LayoutService.Configuration.DefaultRenderingConfiguration, Sitecore.LayoutService">
            <!-- change below to SimplePlaceholdersResolver -->
            <placeholdersResolver type="Sitecore.LayoutService.Placeholders.DynamicPlaceholdersResolver, Sitecore.LayoutService" />

Change the <placeholdersResolver /> node to use the built-in Sitecore.LayoutService.Placeholders.SimplePlaceholdersResolver. The "simple" resolver allows you to use non-dynamic placeholder keys.

2

It's because of Dynamic placeholders. You should put your Inner Sublayout component to placeholder centercolumn-{110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}-0, GUID stands for parent rendering ID.
However I don't know if Dynamic placeholders are the only option, if it is possible to switch to Static ones and how to configure it via Content Editor. When using Experience editor – these IDs being inserted automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.