I have created a site template using PNP framework:
<pnp:Section Order="3" Type="OneColumnFullWidth">
<pnp:Controls>
<pnp:CanvasControl WebPartType="Image" JsonControlData="{"id": "d1d91016-032f-456d-98a4-721247c305e8", "instanceId": "beb70bd5-7993-4b79-ad1b-2107dec09eb8", "title": "\n Image\n ", "description": "\n Show an image on your page\n ", "dataVersion": "1.11", "properties": {"imageSourceType":2,"altText":"","overlayText":"","siteId":"","webId":"","listId":"","uniqueId":"ed149dc0-5ae8-448b-a7a0-e5f519361804","imgWidth":6016,"imgHeight":4016,"isFullWidth":true,"cropX":0,"cropY":620,"cropWidth":6016,"cropHeight":2028,"fixAspectRatio":false,"captionText":"","alignment":"Center","overlayTextStyles":{"textColor":"light","isBold":false,"isItalic":false,"textBoxColor":"dark","textBoxOpacity":0.54,"overlayColor":"light","overlayTransparency":0}}, "serverProcessedContent": {"htmlStrings":{},"searchablePlainTexts":{},"imageSources":{"imageSource":"/_LAYOUTS/IMAGES/VISUALTEMPLATEIMAGE9.JPG"},"links":{},"customMetadata":{"imageSource":{"siteId":"","webId":"","listId":"","uniqueId":"ed149dc0-5ae8-448b-a7a0-e5f519361804","width":6016,"height":4016,"cropX":0,"cropY":620,"cropWidth":6016,"cropHeight":2028}}}, "dynamicDataPaths": {}, "dynamicDataValues": {}}" ControlId="d1d91016-032f-456d-98a4-721247c305e8" Order="1" Column="1" />
</pnp:Controls>
</pnp:Section>
<pnp:Section Order="4" Type="ThreeColumn">
<pnp:Controls>
<pnp:CanvasControl WebPartType="Image" JsonControlData="{"id": "d1d91016-032f-456d-98a4-721247c305e8", "instanceId": "af4e84a1-1d4f-45d0-94d9-6c1232271279", "title": "\n Image\n ", "description": "\n Show an image on your page\n ", "dataVersion": "1.11", "properties": {"imageSourceType":2,"altText":"\n a body of water\n ","overlayText":"\n Add your text here.\n \n","fileName":"","siteId":"","webId":"","listId":"","uniqueId":"1730befb-02e2-440d-8239-6d1b7d44218e","imgWidth":5517,"imgHeight":3702,"isFullWidth":true,"cropX":0,"cropY":12,"cropWidth":5517,"cropHeight":3678,"fixAspectRatio":true,"isOverlayTextEnabled":true,"captionText":"","alignment":"Center","overlayTextStyles":{"textColor":"light","isBold":false,"isItalic":false,"textBoxColor":"dark","textBoxOpacity":0.54,"overlayColor":"light","overlayTransparency":0,"position":{"offsetX":0,"offsetY":0}}}, "serverProcessedContent": {"htmlStrings":{},"searchablePlainTexts":{},"imageSources":{"imageSource":"/_LAYOUTS/IMAGES/VISUALTEMPLATEIMAGE7.JPG"},"links":{},"customMetadata":{"imageSource":{"siteId":"","webId":"","listId":"","uniqueId":"1730befb-02e2-440d-8239-6d1b7d44218e","width":5517,"height":3702,"cropX":0,"cropY":12,"cropWidth":5517,"cropHeight":3678}}}, "dynamicDataPaths": {}, "dynamicDataValues": {}}" ControlId="d1d91016-032f-456d-98a4-721247c305e8" Order="1" Column="1" />
<pnp:CanvasControl WebPartType="Text" ControlId="5db27991-a061-4a30-ab9e-bc856633208f" Order="2" Column="1">
<pnp:CanvasControlProperties>
<pnp:CanvasControlProperty Key="Text" Value="<span class="fontSizeMediumPlus">Above is an image with a text overlay. Click inside the image to replace the text with your own. &nbsp;</span>" />
</pnp:CanvasControlProperties>
</pnp:CanvasControl>
<pnp:CanvasControl WebPartType="Image" JsonControlData="{"id": "d1d91016-032f-456d-98a4-721247c305e8", "instanceId": "203e35f5-f398-40b0-b246-8e8c9a4e8b9d", "title": "\n Image\n ", "description": "\n Show an image on your page\n ", "dataVersion": "1.11", "properties": {"imageSourceType":2,"altText":"","overlayText":"\n Add your text here.\n \n","siteId":"","webId":"","listId":"","uniqueId":"54b4930e-619d-48f5-85ad-0dde8f5aea3f","imgWidth":8832,"imgHeight":4968,"isFullWidth":true,"cropX":690,"cropY":0,"cropWidth":7452,"cropHeight":4968,"fixAspectRatio":true,"isOverlayTextEnabled":true,"captionText":"","alignment":"Center","overlayTextStyles":{"textColor":"light","isBold":false,"isItalic":false,"textBoxColor":"dark","textBoxOpacity":0.54,"overlayColor":"light","overlayTransparency":0,"position":{"offsetX":0,"offsetY":0}}}, "serverProcessedContent": {"htmlStrings":{},"searchablePlainTexts":{},"imageSources":{"imageSource":"/_LAYOUTS/IMAGES/VISUALTEMPLATEIMAGE2.JPG"},"links":{},"customMetadata":{"imageSource":{"siteId":"","webId":"","listId":"","uniqueId":"54b4930e-619d-48f5-85ad-0dde8f5aea3f","width":8832,"height":4968,"cropX":690,"cropY":0,"cropWidth":7452,"cropHeight":4968}}}, "dynamicDataPaths": {}, "dynamicDataValues": {}}" ControlId="d1d91016-032f-456d-98a4-721247c305e8" Order="1" Column="2" />
<pnp:CanvasControl WebPartType="Text" ControlId="0a70cd50-c12d-4dd4-8fcc-f54ff8fdac5b" Order="2" Column="2">
<pnp:CanvasControlProperties>
<pnp:CanvasControlProperty Key="Text" Value="<span class="fontSizeMediumPlus">Above is an image with a text overlay. Click inside the image to replace the text with your own. &nbsp;</span>" />
</pnp:CanvasControlProperties>
</pnp:CanvasControl>
<pnp:CanvasControl WebPartType="Image" JsonControlData="{"id": "d1d91016-032f-456d-98a4-721247c305e8", "instanceId": "21d6dc70-e714-4990-992c-556f3c233e74", "title": "\n Image\n ", "description": "\n Show an image on your page\n ", "dataVersion": "1.11", "properties": {"imageSourceType":2,"altText":"","overlayText":"\n Add your text here.\n \n","siteId":"","webId":"","listId":"","uniqueId":"d04aa0c8-0444-4f92-ba42-5601d9356b98","imgWidth":4608,"imgHeight":3456,"isFullWidth":true,"cropX":0,"cropY":192,"cropWidth":4608,"cropHeight":3072,"fixAspectRatio":false,"isOverlayTextEnabled":true,"captionText":"","alignment":"Center","overlayTextStyles":{"textColor":"light","isBold":false,"isItalic":false,"textBoxColor":"dark","textBoxOpacity":0.54,"overlayColor":"light","overlayTransparency":0,"position":{"offsetX":0,"offsetY":0}}}, "serverProcessedContent": {"htmlStrings":{},"searchablePlainTexts":{},"imageSources":{"imageSource":"/_LAYOUTS/IMAGES/VISUALTEMPLATEIMAGE10.JPG"},"links":{},"customMetadata":{"imageSource":{"siteId":"","webId":"","listId":"","uniqueId":"d04aa0c8-0444-4f92-ba42-5601d9356b98","width":4608,"height":3456,"cropX":0,"cropY":192,"cropWidth":4608,"cropHeight":3072}}}, "dynamicDataPaths": {}, "dynamicDataValues": {}}" ControlId="d1d91016-032f-456d-98a4-721247c305e8" Order="1" Column="3" />
<pnp:CanvasControl WebPartType="Text" ControlId="d96d37c8-d729-46ae-9cf9-3f4c316ec88e" Order="2" Column="3">
<pnp:CanvasControlProperties>
<pnp:CanvasControlProperty Key="Text" Value="<span class="fontSizeMediumPlus">Above is an image with a text overlay. Click inside the image to replace the text with your own. &nbsp;</span>" />
</pnp:CanvasControlProperties>
</pnp:CanvasControl>
</pnp:Controls>
</pnp:Section>
<pnp:Section Order="5" Type="OneColumnFullWidth">
<pnp:Controls>
<pnp:CanvasControl WebPartType="Image" JsonControlData="{"id": "d1d91016-032f-456d-98a4-721247c305e8", "instanceId": "aaa96f85-b30a-4927-a87f-7ebe7fdce9ed", "title": "\n Image\n ", "description": "\n Show an image on your page\n ", "dataVersion": "1.11", "properties": {"imageSourceType":2,"altText":"","overlayText":"","siteId":"","webId":"","listId":"","uniqueId":"f46ca4be-b168-4ef2-b91a-dbbde97d31af","imgWidth":4800,"imgHeight":2696,"isFullWidth":true,"cropX":0,"cropY":633,"cropWidth":4800,"cropHeight":1372,"fixAspectRatio":false,"captionText":"","alignment":"Center","overlayTextStyles":{"textColor":"light","isBold":false,"isItalic":false,"textBoxColor":"dark","textBoxOpacity":0.54,"overlayColor":"light","overlayTransparency":0}}, "serverProcessedContent": {"htmlStrings":{},"searchablePlainTexts":{},"imageSources":{"imageSource":"/_LAYOUTS/IMAGES/VISUALTEMPLATEIMAGE11.JPG"},"links":{},"customMetadata":{"imageSource":{"siteId":"","webId":"","listId":"","uniqueId":"f46ca4be-b168-4ef2-b91a-dbbde97d31af","width":4800,"height":2696,"cropX":0,"cropY":633,"cropWidth":4800,"cropHeight":1372}}}, "dynamicDataPaths": {}, "dynamicDataValues": {}}" ControlId="d1d91016-032f-456d-98a4-721247c305e8" Order="1" Column="1" />
</pnp:Controls>
</pnp:Section>
</pnp:Sections>
But I am getting following error while applying template
You can't use a OneColumnFullWidth section in this site template GROUP
Please find code snippet I am using for apply template:
static void ApplyProvisioningTemplate(string targetWebUrl, string userName, string pwdS)
{
SecureString pwd = new SecureString();
foreach (char c in pwdS.ToCharArray()) pwd.AppendChar(c);
var site = new Uri(targetWebUrl);
if (GetContext(site, userName, pwdS, out var ctx))
{
using (ctx)
{
// ctx.Credentials = new NetworkCredentials(userName, pwd);
//ctx.Credentials = new SharePointOnlineCredentials(userName, pwd);
ctx.RequestTimeout = Timeout.Infinite;
Web web = ctx.Web;
ProvisioningTemplateApplyingInformation ptai = new ProvisioningTemplateApplyingInformation();
ptai.ProgressDelegate = delegate (String message, Int32 progress, Int32 total)
{
Console.WriteLine("{0:00}/{1:00} - {2}", progress, total, message);
};
// Associate file connector for assets
XMLFileSystemTemplateProvider connector = new XMLFileSystemTemplateProvider(@"C:\temp\pnpprovisioningdemo", "");
// template.Connector = connector;
var template = connector.GetTemplate("PnPProvisioningDemo3.xml");
// Because the template is actual object, we can modify this using code as needed
//template.Lists.Add(new ListInstance()
//{
// Title = "PnP Sample Contacts",
// Url = "lists/PnPContacts",
// TemplateType = (Int32)ListTemplateType.Contacts,
// EnableAttachments = true
//});
web.ApplyProvisioningTemplate(template, ptai);
}
}
}
Why I am getting the above error? Is there anyway to onecolumnfullwidth to work in .net core? I am ready to migrate to another package or framework.