Jan 10 2023 07:04 AM
I've created a subsite for my communications night, and I need to create a full width column to house my hero content?
Is there any reason why this is not available to me?
Thanks
Jan 10 2023 07:36 AM
@Lee-Martin
How did you create the subsite? Through the UI?
Then you most likely created a team site, not a communication site.
Full-Width sections are not available on team sites.
There does not seem to be an option in the UI to create a communication site as a subsite.
So you need to use PNP PowerShell to connect to the parent site and execute these commands:
$Locale = 1031 #1033 English /1031 German
$SiteUrl= "MySubsite"
$Template = "SITEPAGEPUBLISHING#0" #Communication Site
New-PnPWeb -Title $SiteUrl -Url $SiteURL -Locale $Locale -Template $Template
Best Regards,
Sven
Jan 10 2023 07:41 AM
Jan 10 2023 07:44 AM
Jan 10 2023 07:46 AM
Jan 10 2023 07:55 AM
Hi @Lee-Martin,
yes, you need to connect to the main site using PNP Powerhshell and then execute the upper commands to create a communication subsite.
Best Regards,
Sven
Jan 11 2023 08:09 AM
Jan 11 2023 08:24 AM
Hi @Lee-Martin ,
Yes
1) Install PnPPowershell (https://pnp.github.io/powershell/) (As local administrator)
Install-Module -Name PnP.PowerShell
2) Connect to your main site
Connect-PnPOnline "https://tenant.sharepoint.com/sites/yoursite" -Interactive
3) Create the subsite
New-PnPWeb -Title "My Communication Subsite" -Url "MyCommunicationSubsite" -Locale 1033 -Template "SITEPAGEPUBLISHING#0"
If you don't want to use PnPPowershell, but pure CSOM Powershell instead, then take a look at this article
https://www.sharepointdiary.com/2016/05/sharepoint-online-powershell-to-create-subsite.html
and the section "SharePoint Online: PowerShell to Create Subsite"
Best Regards,
Sven
Jan 11 2023 08:28 AM
Jan 11 2023 09:04 AM
Hello @Lee-Martin
Do wou mean the "SharePoint Online Management Shell"? (https://learn.microsoft.com/en-us/powershell/sharepoint/sharepoint-online/introduction-sharepoint-on...
I don't think creating a subsite works with that, as you are connected with the admin-site and not the sitecollection where you want to create the subsite.
The subsite creation process needs these 4 parameters to work
I just inlined all these parameters into a single powershell call:
New-PnPWeb -Title "My Communication Subsite" -Url "MyCommunicationSubsite" -Locale 1033 -Template "SITEPAGEPUBLISHING#0"
I often use PnP Powershell with the "-DeviceLogin" parameter.
Connect-PnPOnline "https://tenant.sharepoint.com/sites/yoursite" -DeviceLogin
I think it is the easiest connection parameter with PnP Powershell. You could give that a try.
Alternatively we could create the subsite directly in your Browser using javascript.
fetch(_spPageContextInfo.webAbsoluteUrl + "/_api/web/webinfos/add", {
method: 'POST',
credentials: 'include',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-RequestDigest': document.getElementById("__REQUESTDIGEST").value
},
body: JSON.stringify({
'parameters': {
'Url': 'MyCommunicationSubsite2',
'Title': 'My Communication Subsite',
'Language': 1033,
'WebTemplate': 'SITEPAGEPUBLISHING#0'
}
})
})
That uses a webservice to create the subsite. Just change URL and Title in lines 11&12 according to your needs.
Best Regards,
Sven
Jan 11 2023 11:21 AM
@Lee-Martin What is the outcome goal you were trying to get to when you created the subsite in the first place? Modern site architectures are "flat" - so communication sites are not designed to have subsites. In fact, you cannot create a communication site that is a subsite so if you did create a subsite, it is a team site. As a best practice, I would not recommend creating subsites - even if you technically can. (I almost always disable subsite creation at the tenant level.) Instead, I would ask why you created the subsite? If you are looking to make a relationship between two sites, consider making one a hub and associating the other site to it. That way, both sites are communication sites - with the benefit of the full width section you want - and you can share navigation and search scope and theme without having to use subsites. But, you get the benefit of governance and permissions independence. If all you want to do is surface content from Site A on Site B, you may be able to use the News or Highlighted Content web parts on Site B and select Site A as the source. See: Planning your SharePoint hub sites - SharePoint in Microsoft 365 | Microsoft Learn. For fun, you can also take a look at Goodnight, Subsites a holiday story for IT (microsoft.com).
Jan 11 2023 11:29 AM
Jan 11 2023 11:39 AM
Jan 11 2023 11:42 AM
Jan 11 2023 11:59 AM
Jan 11 2023 12:02 PM
Jan 11 2023 01:03 PM
Jan 12 2023 04:54 AM