PnP-Provisioning-Schema
PnP-Provisioning-Schema copied to clipboard
Add content type definition at list level
In the current schema pnp:listInstance
allows to reference content types defined at site level in the pnp:ContentTypeBindings
element. There is no option to define content types at list level, which is currently supported by SharePoint, which includes adding list-level columns to such content types.
This restricts from replicating of existing functionality during migrations. Re-defining of content types at site level doesn't work in all cases, e.g. when the content type is referencing fields defined at list level, and a field with exactly the same internal name exists in another list. The field GUIDs would also clash (see Issue #192).
It also causes errors in Get-PnpSiteTemplate.
In the following example, pay attention to the content type RFE
:
In the exported template the RFE content type 0x0120D520008CD19F86358D0F48945657A43A020469
becomes 0x0120D520
(Document Set), and the default content type becomes 0x0101
(Document)
And, the default content type should be RFE, which is a document set, not a document.
To overcome the limitations and address the issues, the following will be required:
- Add
pnp:ContentTypes
element topnp:ListInstance
- Update core library to export content types defined at list level that reference fields defined at list level
- Update core library to create content types defined at list level
Related: Issue #185
Uh oh. Ran into this as well. I need to add a field to a list content type, not the site content type. This seems impossible right now? cc @PaoloPia
@Ruslan-Urban @PaoloPia @heinrich-ulbricht this still an issue right? I am trying to set default view to content type which is also document set to different default view as for document library default one. It seems in contentype schema were is line: <wpv:WelcomePageView xmlns:wpv="http://schemas.microsoft.com/office/documentsets/welcomepageview" ViewId="e5059152-5e4e-418c-8c2e-7c4094fb77e1" />
is were a way to change it via powershell during provisioning?
@Ruslan-Urban @PaoloPia @heinrich-ulbricht this still an issue right? I am trying to set default view to content type which is also document set to different default view as for document library default one. It seems in contentype schema were is line: <wpv:WelcomePageView xmlns:wpv="http://schemas.microsoft.com/office/documentsets/welcomepageview" ViewId="e5059152-5e4e-418c-8c2e-7c4094fb77e1" />
is were a way to change it via powershell during provisioning?
I am trying to attempt the same. I would like a PS script to update or set the Document Set > Welcome Page View > ViewId
I tried updating the SchemaXML but it is read-only. Any help is appreciated.