Currently, each time I'm doing deploying jss using
jss deploy package -c -d
I need to manually unprotect the Item of my App Layout to include my placeholders.
Any ideas how to stop this?
The placeholders for the layout item are handled a bit differently than placeholders defined within your JS components because they are the top level placeholders that Layout Service needs to render.
Two potential solutions:
Create a component that is assigned to the
main placeholder. Then in that component declare your
PH__main placeholders. Be sure to update your manifest declarations accordingly.
/sitecore/config/jss-basic-app-vue-web.config file in your JS app, find the
This will tell the import service which placeholders should be defined for the JSS app layout. Be sure to deploy/copy your modified config file to your Sitecore instance after making the change.
For #2, the
app config node inherits default values from the app definition found in
Also note: these approaches are valid for the other JS libs as well, e.g. React, Angular.