Sitecore / jss

Software development kit for JavaScript developers building web applications with Sitecore Experience Platform
https://jss.sitecore.com
Apache License 2.0
261 stars 275 forks source link

Placeholders in component-content not supported #137

Closed cahillwi closed 5 years ago

cahillwi commented 5 years ago

When attempting to create an item in component-content that would be reused across the site ie: a footer, if this component has placeholders they are not rendered when referenced in the route by id. This is while in disconnected mode and using react. It will pick up the component and all the fields specified but anything that is listed as a placeholder does not get picked up. Is there a way to create a shared component that contains placeholders?

kamsar commented 5 years ago

Nesting layouts like that is not easily possible in Sitecore as the complete layout exists on the route, not the component content (which is a block of content that might be referred to by a route layout, but does not itself have a layout)

If you're looking for a reusable footer with layout, check out static context renderings: https://jss.sitecore.com/docs/techniques/extending-layout-service/layoutservice-static-context-rendering

bouncehead13 commented 5 years ago

@kamsar Can you suggest an alternative than adding static renderings?

Let me explain a use case

In our application we have 3 different navs/footers changing based on the route. In each route we reference by id { id: 'GeneralNav' }, but the placeholder to add/remove routes does not work. We need it to be dynamic.

Any help is appreciated!