Home

Using PnP to customise a new Document Library

%3CLINGO-SUB%20id%3D%22lingo-sub-177946%22%20slang%3D%22en-US%22%3EUsing%20PnP%20to%20customise%20a%20new%20Document%20Library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-177946%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20all%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHoping%20someone%20could%20possibly%20help%20please.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EQuite%20new%20to%20the%20PnP%20framework%2C%20but%20it%E2%80%99s%20something%20I%E2%80%99m%20very%20keen%20to%26nbsp%3Bfully%20understand%20and%20make%20use%20of%20in%20our%20organisation.%20So%20far%2C%20I%20have%20managed%20to%20provision%20a%20team%20site%20based%20on%20our%20organisational%20template.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHowever%2C%20a%20couple%20of%20things%20still%20elude%20me%20which%20would%20ensure%20our%20existing%20template%20would%20have%20parity%20with%20the%20PnP%20one.%20The%20first%20area%26nbsp%3Bis%20customising%20the%20OOTB%20document%20library%20with%20our%20own%20custom%20content%20types%20and%20site%20columns.%20I%E2%80%99ve%20managed%20to%20do%20it%20for%20the%20initial%20provisioning%20process%2C%20but%20the%20bit%20I%E2%80%99m%20drawing%20a%20blank%20on%20is%20when%20a%20user%20creates%20a%20new%20document%20library%20from%20either%20addanapp.aspx%20page%20or%20through%26nbsp%3Ba%20Modern%20Page%2C%20since%20that%20doesn%E2%80%99t%20use%20our%20content%20types%20or%20site%20columns.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20old%20days%2C%20we%20were%20using%20classic%2C%20so%20it%20was%20easy%20to%20remove%20the%20OOTB%20document%20library%20from%20the%20addanapp.aspx%20page%20and%20replace%20it%20with%20our%20own%20STP%20template.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%E2%80%99ve%20been%20reading%20about%20the%20ECM%20Document%20Library%20core%2C%20event%20receivers%20and%20possibly%20even%20CSOM%20to%20achieve%20what%20I%E2%80%99m%20looking%20to%20do%2C%20but%20not%20sure%20which%20is%20the%20best%20method%20to%20adopt%20here%20and%20how%20I%20go%20about%20implementing%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIdeally%2C%20the%20outcome%20I'm%20looking%20to%20achieve%20is%20I%20want%20any%20new%20document%20library%20a%20user%20creates%20from%20a%20Modern%20Team%20Site%20to%20use%20only%20our%20custom%20content%20types%20and%20site%20columns%2C%20not%20the%20default%20OOTB%20ones.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAny%20ideas%20on%20how%20I%20go%20about%20achieving%20this%20at%20all%20please%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-177946%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Steve Johnson
Occasional Contributor

Hey all,

 

Hoping someone could possibly help please.

 

Quite new to the PnP framework, but it’s something I’m very keen to fully understand and make use of in our organisation. So far, I have managed to provision a team site based on our organisational template.

 

However, a couple of things still elude me which would ensure our existing template would have parity with the PnP one. The first area is customising the OOTB document library with our own custom content types and site columns. I’ve managed to do it for the initial provisioning process, but the bit I’m drawing a blank on is when a user creates a new document library from either addanapp.aspx page or through a Modern Page, since that doesn’t use our content types or site columns.

 

In the old days, we were using classic, so it was easy to remove the OOTB document library from the addanapp.aspx page and replace it with our own STP template.

 

I’ve been reading about the ECM Document Library core, event receivers and possibly even CSOM to achieve what I’m looking to do, but not sure which is the best method to adopt here and how I go about implementing it.

 

Ideally, the outcome I'm looking to achieve is I want any new document library a user creates from a Modern Team Site to use only our custom content types and site columns, not the default OOTB ones.

 

Any ideas on how I go about achieving this at all please?

 

Thanks