0

Is there a way to find out what Page Layout and / or template a Sub-Site or it's publishing pages are using? Something in the Site Settings or the Library Settings?

2 Answers 2

0

For Publishing pages, you can find the name of page layouts Page Layouts column provided in Pages library. Perhaps, if you can't see that column in view, you can add that column in view by editing the view. Click on the page layout name will open that page layout in browser tab. Please see the below attached image for the same:

enter image description here

To check the base Site Template to be used to create your subsite, PowerShell commands is the easiest way. Execute below commands to get the site template name:

$web = Get-SPWeb "http://<server-name>/abc"
write-host "Web Template:" $web.WebTemplate " | Web Template ID:" $web.WebTemplateId
$web.Dispose()

Hope this will help you!

0

I assumed you are asking for SharePoint on-premise, however, it is applicable for SharePoint online as well.

This is the subsite creation template - once we go to the subsite creation page from the site content, we will get the below screen.

Create subsite in SharePoint

So, basically - it uses the parent site template hierarchy - I mean what are the templates are available for site collection, the same would be available for the subsite - however, SharePoint administrator can manage the template selection page in a subsite, like what are template should be available under the subsite creation.

Now, how do we get the site template details after creating the site?

Using the below PowerShell script, we can get the site template details for the specific given site.

$subWeb = Get-SPWeb http:/mysitecollection/subsite
$subWeb.WebTemplate + " " + $subWeb.WebTemplateId
$subWeb.close()

Now, if we want to get a list of sites and the site template in a web application, we can use the below script.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get All site collections
$SiteCollections = Get-SPWebApplication "http://sp" | Get-SPSite -Limit All
#Loop through all site collections
 foreach($Site in $SiteCollections)
    {
        #Loop throuh all Sub Sites
       foreach($Web in $Site.AllWebs)
       {
     Write-Host $web.title ": " $web.URL "  Tmplate: " $web.WebTemplate
      }
        Write-Host ""
      }

Script Source:

PowerShell to get all subsites and site template

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.