Create Picture Library in a Communication Site
On 3 minutesUpdate
You can enable Team Collaboration Lists feature to get access to all the default apps in a team site.
You can create a picture library in a communication site using the PnP provisioning template.
Below is the xml template to create a picture library named Banners. You can substitute banners with the name of the picture library you want to create.
<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2020/02/ProvisioningSchema">
<pnp:Preferences Generator="OfficeDevPnP.Core, Version=3.22.2006.2, Culture=neutral, PublicKeyToken=5e633289e95c321a" />
<pnp:Templates ID="CONTAINER-TEMPLATE-44CFD9C6658C47D89595FA4F33D054FF">
<pnp:ProvisioningTemplate ID="TEMPLATE-44CFD9C6658C47D89595FA4F33D054FF" Version="1" BaseSiteTemplate="STS#0" Scope="RootSite">
<pnp:Lists>
<pnp:ListInstance Title="Banners" Description="" DocumentTemplate="" TemplateType="109" Url="Banners" MinorVersionLimit="0" MaxVersionLimit="0" DraftVersionVisibility="0" TemplateFeatureID="00bfea71-52d4-45b3-b544-b1c71b620109" ContentTypesEnabled="true" EnableAttachments="false" DefaultDisplayFormUrl="{site}/Banners/Forms/DispForm.aspx" DefaultEditFormUrl="{site}/Banners/Forms/EditForm.aspx" DefaultNewFormUrl="{site}/Banners/Forms/Upload.aspx" ImageUrl="/_layouts/15/images/itil.png?rev=47" IrmExpire="false" IrmReject="false" IsApplicationList="false" ValidationFormula="" ValidationMessage="">
<pnp:PropertyBagEntries>
<pnp:PropertyBagEntry Key="IsAttachmentLibrary" Value="0" Overwrite="false" />
</pnp:PropertyBagEntries>
<pnp:ContentTypeBindings>
<pnp:ContentTypeBinding ContentTypeID="0x010102" Default="true" />
<pnp:ContentTypeBinding ContentTypeID="0x0120" />
</pnp:ContentTypeBindings>
<pnp:Views>
<View Name="{7F793C3D-F302-4F87-AAB2-EC76A8DD0E9B}" MobileView="TRUE" MobileDefaultView="TRUE" Type="HTML" DisplayName="All Pictures" Url="{site}/Banners/Forms/AllItems.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/15/images/plicon.png?rev=47">
<Query>
<OrderBy>
<FieldRef Name="FileLeafRef" />
</OrderBy>
</Query>
<ViewFields>
<FieldRef Name="DocIcon" />
<FieldRef Name="LinkFilename" />
<FieldRef Name="ImageSize" />
<FieldRef Name="FileSizeDisplay" />
<FieldRef Name="Modified" />
<FieldRef Name="RequiredField" Explicit="TRUE" />
<FieldRef Name="PreviewOnForm" Explicit="TRUE" />
</ViewFields>
<RowLimit Paged="TRUE">40</RowLimit>
<JSLink>clienttemplates.js|callout.js</JSLink>
</View>
<View Name="{4407A5B5-DF75-4377-8955-1CADB6F626AF}" DefaultView="TRUE" Type="HTML" DisplayName="Thumbnails" Url="{site}/Banners/Forms/Thumbnails.aspx" Level="1" BaseViewID="6" ContentTypeID="0x" ImageUrl="/_layouts/15/images/plicon.png?rev=47">
<Query>
<OrderBy>
<FieldRef Name="FileLeafRef" />
</OrderBy>
</Query>
<ViewFields>
<FieldRef Name="DocIcon" />
<FieldRef Name="LinkFilenameNoMenu" />
<FieldRef Name="ImageSize" />
<FieldRef Name="FileSizeDisplay" />
<FieldRef Name="Modified" />
<FieldRef Name="Created_x0020_Date" Explicit="TRUE" />
<FieldRef Name="Author" Explicit="TRUE" />
<FieldRef Name="Editor" Explicit="TRUE" />
<FieldRef Name="RequiredField" Explicit="TRUE" />
<FieldRef Name="ImageWidth" Explicit="TRUE" />
<FieldRef Name="ImageHeight" Explicit="TRUE" />
<FieldRef Name="NameOrTitle" Explicit="TRUE" />
<FieldRef Name="PreviewOnForm" Explicit="TRUE" />
</ViewFields>
<RowLimit Paged="TRUE">30</RowLimit>
<JSLink>SP.UI.TileView.js|callout.js</JSLink>
</View>
<View Name="{B48B63E2-F54B-485C-99D2-37D6B06A87BD}" Type="HTML" TabularView="FALSE" DisplayName="Slides" Url="{site}/Banners/Forms/SinglePict.aspx" Level="1" BaseViewID="2" ContentTypeID="0x" ImageUrl="/_layouts/15/images/plicon.png?rev=47">
<Query>
<OrderBy>
<FieldRef Name="FileLeafRef" />
</OrderBy>
</Query>
<ViewFields>
<FieldRef Name="LinkFilenameNoMenu" />
<FieldRef Name="FileSizeDisplay" />
<FieldRef Name="ImageSize" />
<FieldRef Name="NameOrTitle" Explicit="TRUE" />
</ViewFields>
<RowLimit Paged="TRUE">1</RowLimit>
<JSLink>clienttemplates.js</JSLink>
</View>
</pnp:Views>
<pnp:Fields>
<Field ID="{d1cff744-ba61-4189-94d6-97d0a9eb4f6a}" Type="Text" DisplayName="Tags" Name="MediaServiceAutoTags" Group="_Hidden" Hidden="FALSE" Sealed="TRUE" ReadOnly="TRUE" ShowInNewForm="FALSE" ShowInDisplayForm="FALSE" ShowInEditForm="FALSE" ShowInListSettings="FALSE" Viewable="FALSE" Json="FALSE" SourceID="{{listid:Banners}}" StaticName="MediaServiceAutoTags" ColName="nvarchar11" RowOrdinal="0" />
<Field ID="{67aff0cf-8e19-43f2-9987-be89075e1467}" Type="Note" DisplayName="Extracted Text" Name="MediaServiceOCR" Group="_Hidden" Hidden="FALSE" Sealed="TRUE" ReadOnly="TRUE" ShowInNewForm="FALSE" ShowInDisplayForm="FALSE" ShowInEditForm="FALSE" ShowInListSettings="FALSE" Viewable="FALSE" Json="FALSE" SourceID="{{listid:Banners}}" StaticName="MediaServiceOCR" ColName="ntext6" RowOrdinal="0" />
</pnp:Fields>
<pnp:FieldRefs>
<pnp:FieldRef ID="8c0d0aac-9b76-4951-927a-2490abe13c0b" Name="PreviewOnForm" DisplayName="Preview" />
<pnp:FieldRef ID="c53a03f3-f930-4ef2-b166-e0f2210c13c0" Name="FileType" DisplayName="File Type" />
<pnp:FieldRef ID="922551b8-c7e0-46a6-b7e3-3cf02917f68a" Name="ImageSize" DisplayName="Picture Size" />
<pnp:FieldRef ID="7e68a0f9-af76-404c-9613-6f82bc6dc28c" Name="ImageWidth" DisplayName="Picture Width" />
<pnp:FieldRef ID="1944c034-d61b-42af-aa84-647f2e74ca70" Name="ImageHeight" DisplayName="Picture Height" />
<pnp:FieldRef ID="a5d2f824-bc53-422e-87fd-765939d863a5" Name="ImageCreateDate" DisplayName="Date Picture Taken" />
<pnp:FieldRef ID="9da97a8a-1da5-4a77-98d3-4bc10456e700" Name="Description" DisplayName="Description" />
<pnp:FieldRef ID="b66e9b50-a28e-469b-b1a0-af0e45486874" Name="Keywords" DisplayName="Keywords" />
<pnp:FieldRef ID="7ebf72ca-a307-4c18-9e5b-9d89e1dae74f" Name="SelectedFlag" DisplayName="Selection Checkbox" />
<pnp:FieldRef ID="76d1cc87-56de-432c-8a2a-16e5ba5331b3" Name="NameOrTitle" DisplayName="Name" />
<pnp:FieldRef ID="de1baa4b-2117-473b-aa0c-4d824034142d" Name="RequiredField" DisplayName="Required Field" />
<pnp:FieldRef ID="ac7bb138-02dc-40eb-b07a-84c15575b6e9" Name="Thumbnail" DisplayName="Thumbnail" />
</pnp:FieldRefs>
</pnp:ListInstance>
</pnp:Lists>
</pnp:ProvisioningTemplate>
</pnp:Templates>
</pnp:Provisioning>
Save the template somewhere and run the following PowerShell script.
# using username & password
$userName = "yourusername"
$passWord = "yourpassword"
$encPassWord = Convertto-Securestring -String $passWord -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $userName, $encPassWord
Connect-PnPOnline -Url "https://tenant.sharepoint.com/sites/yoursite" -Credentials $cred
# When multifactor auth is in place
Connect-PnPOnline -Url "https://tenant.sharepoint.com/sites/yoursite" -UseWebLogin
Apply-PnPProvisioningTemplate -Path "template.xml"
Other posts you might be interested in
- Create Announcement List in a Communication Site
- Fix: Cannot connect SharePoint Designer to Modern Team sites
- Fix Connect-SPOService : Could not authenticate to SharePoint Online using OAuth 2.0
- Export and Import SharePoint Document & List Schema
- How to Remove the Top Banner from SharePoint Online Modern Pages