Add Content Type to Pages libary in differnt languages sites

New Contributor

I want to add a Content Type to the Pages Library on different sites with different languages on a SharePoint On Premises. Since the name and url of the Pages library in SharePoint is in the languages of the site ("Pages", "Seiten", "Pagine", ...) I cannot use simply use "Pages".


Currently I use one Office PnP Template which is applied with PowerShell. Is there a way in the Office PnP Template to add a ContentType to a Pages Library in all languages or to get the name of the Pages Library with the PnP Powershell?


1 Reply

I a solution. In Powershell I can get the name with:

   $pageListName = (Get-PnPWeb $newsUrl -Includes AllProperties).AllProperties.FieldValues.__pageslistname


Add the value as parameter into the template:

      <pnp:Parameter Key="PageListName" Required="true"/>


<pnp:ListInstance Title="{parameter:PageListName}" TemplateType="850" Url="{PageListName}" ContentTypesEnabled="true" ForceCheckout="true" EnableVersioning="true" EnableMinorVersions="true" EnableModeration="true" DraftVersionVisibility="2">