May 31 2017 01:25 AM
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?
May 31 2017 03:49 AM
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:Parameters>
<pnp:Parameter Key="PageListName" Required="true"/>
</pnp:Parameters>
...
<pnp:ListInstance Title="{parameter:PageListName}" TemplateType="850" Url="{PageListName}" ContentTypesEnabled="true" ForceCheckout="true" EnableVersioning="true" EnableMinorVersions="true" EnableModeration="true" DraftVersionVisibility="2">