Jan 23 2021 04:39 PM - edited Jan 23 2021 04:44 PM
Hi,
Adding a column to the Site Pages library using the UI has the option "Add to all content types" which seems to be missing in Site Script. So, adding a site column via Site Script as below results that columns is only inherited by the Site Page content type and not the Repost Page.
"actions": [
{
"verb": "createSPList",
"listName": "Site Pages",
"templateType": 119,
"subactions": [
{
"verb": "addSiteColumn",
"internalName": "PageCategory",
"addToDefaultView": true
}
...
}
Results in:
Repost Page not inheriting
This could be solved by modifying the base site content type:
"actions": [
{
"verb": "createContentType",
"name": "Site Page",
"description": "Create a new site page",
"hidden": false,
"parentName": "Document",
"subactions":
[
{
"verb": "addSiteColumn",
"internalName": "PageCategory"
}
]
},
{
"verb": "createContentType",
"name": "Repost Page",
"description": "Used to create a News link post. If deleted, the News link option will be disabled for users.",
"hidden": false,
"parentName": "Site Page",
"subactions":
[
{
"verb": "addSiteColumn",
"internalName": "PageCategory"
}
]
},
{
"verb": "createSPList",
"listName": "Site Pages",
"templateType": 119,
"subactions": [
{
"verb": "addContentType",
"name": "Site Page"
},
{
"verb": "addContentType",
"name": "Repost Page"
}
...
}
So, to my questions:
NOTE: Want to use Site Design/Site Script and would like to avoid creating own content type in this case.
/Adam