I am using Sitecore 10.3 with SXA and JSS. For the head setup I used a post from Dan Cruickshank and that worked fine. I did get a nice blank homepage and no errors.
I created 3 partial designs and added those to a design which I linked to the default page template. So far still fine. But as soon as I add components to any of the partial designs it goes wrong. It seems to be a mismatch in placeholder naming, but not sure how to fix it - especially since this is still all out-of-the-box SXA and the starter template.
The error in the logs are "placeholder 'sxa-header' was not found in the current rendering data
" (I named the partial "header"). It's a very typical error in JSS setups but I don't know how and where to fix this in SXA 10.3.
What I noticed:
- when I create a partial design "header", a placeholder setting item is created with the same name and a placeholder key "sxa-header".
- when I add components in this partial design, those components are added in the placeholders that are defined in the layout file which are called like "
headless-header
"
The rendered layout as seen in the graphql ui looks like:
"headless-header": [
{
"uid": "36add71b-256e-4af8-9a76-6b764e0013d4",
"componentName": "PartialDesignDynamicPlaceholder",
"dataSource": "",
"params": {
"sid": "{5C0F944B-5573-471D-824B-9BF6AF058FB0}",
"ph": "headless-header",
"sig": "sxa-header"
}
}
],
So I have a ph
which is consistent with the placeholder and a sig
which refers to the placeholder key in the local (site) placeholder settings item.
I tried several things (things that I should not be doing in a standard SXA setup but just to debug and understand the issue) but nothing worked so far.
The error comes from the PartialDesignDynamicPlaceholder
component. This uses indeed the sig parameter: <Placeholder name={props.rendering?.params?.sig || ''} rendering={props.rendering} />
.
I assume I am just missing something silly, but I'm not sure what and can't find something in the documentation. Any ideas?
Small update: I managed to get rid of the errors by adding the placeholders to the "Layout Service Placeholders" field of the "PartialDesign Dynamic Placeholder" rendering. Which is something I should not be doing manually (especially as I need to use raw values tricks to add them). But I still get an empty page so now I have no errors and no data :(