Forum Discussion
David Moore
Sep 29, 2016Copper Contributor
OfficeDev PnP - Provision Page content?
I know there's a <pnp:Pages> element in the schema, but it seems to only provision web part XML. Is there any way to add just HTML to a wiki page content, rather than having to wrap it in a Content E...
Sep 30, 2016
David,
What you could do is use a current team site, with a wiki page as welcome page. Add some text/html to this page and use below powershell command to extract this site as template:
Connect-SPOnline -Url "Url to your team site"
Get-SPOProvisioningTemplate -Out "C:\temp\teamsite.xml
Within the extracted template, lookup your page (pnp:Pages element). Within the page there should be a Field called 'WikiField'. Your html is in here. So to put html in a page and provision it within a template: put it in this field.
<pnp:Field FieldName="WikiField"><![CDATA[<div class="ExternalClass972799D44F734918B33EB6504C516F27"><table id="layoutsTable" style="width:100%;"><tbody><tr style="vertical-align:top;"><td style="width:100%;"><div class="ms-rte-layoutszone-outer" style="width:100%;"><div class="ms-rte-layoutszone-inner" style="min-height:420px;"><p>This is some test <strong>text.</strong><br></p></div></div></td></tr></tbody></table><span id="layoutsData" style="display:none;">false,false,1</span></div>]]></pnp:Field>
Deleted
Sep 30, 2016even better to use it without the webpart thanks Robert Schouten