Forum Discussion
Home.aspx content and webparts when extracting PnP site provisioning schema?
- Jan 14, 2017
A little update from the PnP Core Team: I just changed the behaviour of the PageContents handler (which is the handler that extracts the homepage). It was checking for the presence of Credentials on the ClientContext and if not present it would not execute the extraction of artifacts. That check is still valid for On-Premises, due to the fact that we have to call a webservice to work around CSOM limitations, but is not needed anymore for SPO as that version of CSOM allows us to export all webparts. I now made that check conditional based upon the version of the NuGet package you're running, and it will be available in version 2.12.1702.0 (the February 2017 release).
Be aware that if you put webparts on the homepage which contain documents/lists that the view is not automaticly the same.
check my blog about views:
http://www.sharepoint-specialist.nu/unable-change-view-list-view-web-part-csom-solution-office365/
- Pasi BergmanNov 01, 2016Copper Contributor
Hi Deleted
Great blog post! Thank you for sharing it. Your post will certainly help after my initial problem has been resolved.
- Nov 01, 2016When you export as .xml files the aspx page itself will not be exported.
You can simple put an .aspx file in the same folder as the .xml manually before you import it. A simple one off export of the page with share point designer will do. You can then use this apsx file for any future pages.
If you use .pnp rather than .xml then all will work fine.
Did you check you .xml files? If you search for webpart do you find anything in the xml?- Pasi BergmanNov 01, 2016Copper Contributor
Thanks again for contributing. This issue is quite annoying and any help is appreciated.
As I mentioned, the extracted provisioning template (xml) does not contain Pages element nor Page element. Below is the result of the initial schema extraction
Get-SPOProvisioningTemplate -Out .\mytemplatesite1.xml
I have removed the content of the AdditionalAdministrators, SiteFields and ContentTypes, but I have not touched anything else.
<?xml version="1.0"?> <pnp: Provisioning xmlns: pnp="http://schemas.dev.office.com/PnP/2016/05/ProvisioningSchema"> <pnp: Preferences Generator="OfficeDevPnP.Core, Version=2.8.1610.1, Culture=neutral, PublicKeyToken=3751622786b357c2" /> <pnp: Templates ID="CONTAINER-TEMPLATE-2912D0BE8A6047548043990D05268BC2"> <pnp: ProvisioningTemplate ID="TEMPLATE-2912D0BE8A6047548043990D05268BC2" Version="1" BaseSiteTemplate="STS#0"> <pnp: WebSettings RequestAccessEmail="someone@example.com" NoCrawl="false" WelcomePage="SitePages/Home.aspx" SiteLogo="" AlternateCSS="" MasterPageUrl="{masterpagecatalog}/seattle.master" CustomMasterPageUrl="{masterpagecatalog}/seattle.master" /> <pnp: RegionalSettings AdjustHijriDays="0" AlternateCalendarType="None" CalendarType="Gregorian" Collation="25" FirstDayOfWeek="Sunday" FirstWeekOfYear="0" LocaleId="1033" ShowWeeks="false" Time24="false" TimeZone="13" WorkDayEndHour="5:00PM" WorkDays="62" WorkDayStartHour="8:00AM" /> <pnp: SupportedUILanguages> <pnp: SupportedUILanguage LCID="1033" /> </pnp: SupportedUILanguages> <pnp: AuditSettings AuditLogTrimmingRetention="90" TrimAuditLog="true"> <pnp: Audit AuditFlag="None" /> </pnp: AuditSettings> <pnp: Security> <pnp: AdditionalAdministrators> </pnp: AdditionalAdministrators> <pnp: Permissions /> </pnp: Security> <pnp: SiteFields> </pnp: SiteFields> <pnp: ContentTypes> </pnp: ContentTypes> <pnp: Features> <pnp: WebFeatures> <pnp: Feature ID="b77b6484-364e-4356-8c72-1bb55b81c6b3" /> </pnp: WebFeatures> </pnp: Features> </pnp: ProvisioningTemplate> </pnp: Templates> </pnp: Provisioning>
Edit: I added spaces after each pnp: to remove the emojis from my reply.