Custom templates for SharePoint document libraries

German post was automatically translated by DeepL API

Templates for SharePoint document libraries were introduced in SharePoint in November 2023. At that time, Microsoft provided three templates.
SharePoint administrators can now create their own templates for document libraries. Microsoft refers to the same method for creating templates as is already possible for SharePoint lists.

Creating a template can be very simple.
Someone prepares a document library with the desired configurations. A SharePoint administrator creates a custom template for document libraries from the library.

You need the PowerShell module Microsoft.Online.SharePoint.PowerShell.
In my simple example, I defined predefined columns and configurations for a document library.

  • Alternatively, someone with experience can create their designs via JSON and prepare a template.
  • Alternatively, you can customize the design from the document library.
PowerShell
# Sample to create an organizational document library template for a SharePoint site

Import-Module Microsoft.Online.SharePoint.PowerShell
Connect-SPOService -url "https://<Tenant>-admin.sharepoint.com"

# Get the site script from the SharePoint list at the specified URL
# For reference read https://learn.microsoft.com/en-us/sharepoint/lists-custom-template
$SiteScript = Get-SPOSiteScriptFromList -ListUrl "https://tam365dev.sharepoint.com/sites/TA-Demo/DemoLibrary" 

# Create a new site script in SharePoint Online with the specified title, description, and content
$NewSiteScript =  Add-SPOSiteScript `
  -Title "Topedia Library Template" `
  -Description "Creates a library from a template" `
  -Content $SiteScript 

# Create a new list design in SharePoint Online with the specified title, description, site scripts, and thumbnail
Add-SPOListDesign `
-Title "Topedia Library Template" `
-Description "Creates a library from a template" `
-SiteScripts $NewSiteScript.id.guid `
-Thumbnail "https://tam365dev.sharepoint.com/sites/TA-Demo/SiteAssets/Pictures/thumbnail.jpeg"


If a document repository is created, SharePoint lists the new template under my organization’s templates. Without templates, the section is hidden.

Benutzerdefinierte Vorlage für Dokumentenablage
Custom template for document libraries

The new document repository is created with predefined configurations depending on the design.

Share
Avatar photo

Topedia Translation Bot

Translation Bot is an automated service to translate posts from German to English. All posts published by the Translation Bot are automatically translated via DeepL and reviewed manually.

Leave a Reply

Your email address will not be published. Required fields are marked *