Site Package: PageContent Folder - akumina/AkuminaDev GitHub Wiki

The PageContent folder will contain the pages.xml file. The pages.xml file contains the markup that will be deployed to the pages by the AddControlsToPages.cs step. A sample pages.xml file is listed below.

<pages xmlns:ak="http://www.w3.org/ak">
  <page name="Home.aspx">
	<zone name="WebPartZone1">
		<contenteditor>
        <h2>Sample home page</h2>
		</contenteditor>
	</zone>
	<zone name="WebPartZone2">
		<contenteditor>
      <div class="ak-controls ak-genericlist-widget" id="{{NewGuid}}" ak:listname="" ak:displaytemplateurl="{{SiteUrl}}/Style Library/digitalworkplace/Content/Templates/GenericList/DepartmentList.html" ak:callbackmethod="ShowDepartmentItems" ak:callbacktype="customdataload"> </div>
		</contenteditor>
	</zone>
  </page>
</pages>

We designate which page that we’re adding content to with the name attribute of the pages tag. This name must correspond to the name of a page we are provisioning. We designate the webpart zone that we want the content deployed to with the name attribute of the zone tag. The name must correspond to the name of the WebPartZone within the page layout that the page inherits from. The contenteditor tag signifies that we want the Content Editor webpart xml deployed to the page. Any content within the contenteditor tag will be added as inner markup to the Content editor webpart. Content can be simple markup as shown below:

<h2>Sample home page</h2>

Or it can be an Akumina widget

<div id="b29505be-b6b4-4eda-af32-7bc2d93d0020" class="ak-widget" rel="HomePage-DeptNews"></div>

Additionaly, multiple Content Editor Web Parts can be placed within the same WebPartZone

<zone name="WebPartZone1">
	<contenteditor>
		  <h2>Sample Multiple Content Editors</h2>
	</contenteditor>	
	<contenteditor>
		  <div id="b29505be-b6b4-4eda-af32-7bc2d93d0020" class="ak-widget" rel="HomePage-DeptNews"></div>
	</contenteditor>
</zone>

To deploy a SharePoint web part into a Classic page, you can use the XML export inside sharepoint. With the XML from the export, you can fit it into the XML using the webpartxml tag, as shown:

<zone name="Refiner">
  <webpartxml>
    <webParts>
      <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
        <metaData>

Full example of a search page, using multiple search web parts:

  <page name="Search.aspx">
    <zone name="Refiner">
      <webpartxml>
        <webParts>
          <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
            <metaData>
              <type name="Microsoft.Office.Server.Search.WebControls.RefinementScriptWebPart, Microsoft.Office.Server.Search, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
              <importErrorMessage>Cannot import Refinment Web Part.</importErrorMessage>
            </metaData>
            <data>
              <properties>
                <property name="HelpUrl" type="string" />
                <property name="UseManagedNavigationRefiners" type="bool">False</property>
                <property name="TitleUrl" type="string" />
                <property name="Hidden" type="bool">False</property>
                <property name="ChromeType" type="chrometype">None</property>
                <property name="AllowClose" type="bool">True</property>
                <property name="TitleIconImageUrl" type="string" />
                <property name="AllowMinimize" type="bool">True</property>
                <property name="AllowEdit" type="bool">True</property>
                <property name="Direction" type="direction">NotSet</property>
                <property name="Height" type="string" />
                <property name="AllowConnect" type="bool">True</property>
                <property name="MissingAssembly" type="string">Cannot import Refinment Web Part.</property>
                <property name="AllowHide" type="bool">True</property>
                <property name="Description" type="string">This webpart helps the users to refine search results</property>
                <property name="StatesJson" type="string">{}</property>
                <property name="QueryGroupName" type="string">Default</property>
                <property name="ChromeState" type="chromestate">Normal</property>
                <property name="ExportMode" type="exportmode">All</property>
                <property name="AllowZoneChange" type="bool">True</property>
                <property name="RenderTemplateId" type="string" />
                <property name="CatalogIconImageUrl" type="string" />
                <property name="EmitStyleReference" type="bool">True</property>
                <property name="HelpMode" type="helpmode">Modeless</property>
                <property name="Title" type="string">Refinement</property>
                <property name="AlternateErrorMessage" type="string" null="true" />
                <property name="Width" type="string" />
                <property name="EmptyMessage" type="string" />
                <property name="ServerIncludeScriptsJson" type="string">null</property>
                <property name="SelectedRefinementControlsJson" type="string">{"refinerConfigurations":[{"propertyName":"FileType","deepHits":100000,"displayName":null,"displayTemplate":"~sitecollection/_catalogs/masterpage/Display Templates/Filters/Filter_Default.js","maxNumberRefinementOptions":21,"type":"Text","refinerSpecStringOverride":null,"useDefaultDateIntervals":false,"isInherited":false,"sortBy":0,"sortOrder":0,"intervals":null,"aliases":null},{"propertyName":"contentclass","deepHits":100000,"displayName":null,"displayTemplate":"~sitecollection/_catalogs/masterpage/Display Templates/Filters/Filter_Default.js","maxNumberRefinementOptions":10,"type":"Text","refinerSpecStringOverride":null,"useDefaultDateIntervals":false,"isInherited":false,"sortBy":0,"sortOrder":0,"intervals":null,"aliases":null},{"propertyName":"ContentTypeId","deepHits":100000,"displayName":null,"displayTemplate":"~sitecollection/_catalogs/masterpage/Display Templates/Filters/Filter_Default.js","maxNumberRefinementOptions":15,"type":"Text","refinerSpecStringOverride":null,"useDefaultDateIntervals":false,"isInherited":false,"sortBy":0,"sortOrder":0,"intervals":null,"aliases":null},{"propertyName":"WebTemplate","deepHits":100000,"displayName":null,"displayTemplate":"~sitecollection/_catalogs/masterpage/Display Templates/Filters/Filter_Default.js","maxNumberRefinementOptions":10,"type":"Text","refinerSpecStringOverride":null,"useDefaultDateIntervals":false,"isInherited":false,"sortBy":0,"sortOrder":0,"intervals":null,"aliases":null},{"propertyName":"DisplayAuthor","deepHits":100000,"displayName":null,"displayTemplate":"~sitecollection/_catalogs/masterpage/Display Templates/Filters/Filter_Default.js","maxNumberRefinementOptions":9,"type":"Text","refinerSpecStringOverride":null,"useDefaultDateIntervals":false,"isInherited":false,"sortBy":0,"sortOrder":0,"intervals":null,"aliases":null},{"propertyName":"LastModifiedTime","deepHits":100000,"displayName":null,"displayTemplate":"~sitecollection/_catalogs/masterpage/Display Templates/Filters/Filter_SliderBarGraph.js","maxNumberRefinementOptions":0,"type":"DateTime","refinerSpecStringOverride":null,"useDefaultDateIntervals":true,"isInherited":false,"sortBy":0,"sortOrder":0,"intervals":null,"aliases":null}]}</property>
              </properties>
            </data>
          </webPart>
        </webParts>
      </webpartxml>
    </zone>
    <zone name="Results">
      <contenteditor>
        <div class="ak-dept-documents ak-module">
          <div class="ms-srch-sbLarge ms-srch-sb-borderFocused" id="ak-dw-searchbox">
            ​<input type="text" maxlength="2048" title="Search..." id="ak-dw-sbox" autocomplete="off" autocorrect="off" class="ms-textLarge ms-srch-sbLarge-fullWidth" /><a title="Search" class="ms-srch-sb-searchLink" id="ak-dw-SearchLink" data-cke-saved-href="javascript:void(0)" href="javascript:void(0)">
              <img data-cke-saved-src="{{SiteUrl}}/_layouts/15/images/searchresultui.png?rev=44" src="{{SiteUrl}}/_layouts/15/images/searchresultui.png?rev=44" class="ms-srch-sbLarge-searchImg" id="ak-dw-searchimg" alt="Search"/>​​​
            </a>
          </div>
        </div>
      </contenteditor>
      <webpartxml>
        <webParts>
          <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
            <metaData>
              <type name="Microsoft.Office.Server.Search.WebControls.SearchBoxScriptWebPart, Microsoft.Office.Server.Search, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
              <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
            </metaData>
            <data>
              <properties>
                <property name="ChromeType" type="chrometype">None</property>
                <property name="QuerySuggestionMinimumPrefixLength" type="int">2</property>
                <property name="Height" type="string" />
                <property name="AdvancedSearchPageAddress" type="string">advanced.aspx</property>
                <property name="AllowEmptySearch" type="bool">False</property>
                <property name="AllowZoneChange" type="bool">True</property>
                <property name="AllowEdit" type="bool">True</property>
                <property name="ShowPreferencesLink" type="bool">False</property>
                <property name="Hidden" type="bool">False</property>
                <property name="UpdatePageTitle" type="bool">False</property>
                <property name="Width" type="string" />
                <property name="Direction" type="direction">NotSet</property>
                <property name="UseSharedSettings" type="bool">False</property>
                <property name="EmitStyleReference" type="bool">True</property>
                <property name="AllowConnect" type="bool">True</property>
                <property name="AllowMinimize" type="bool">True</property>
                <property name="AllowClose" type="bool">True</property>
                <property name="HelpMode" type="helpmode">Modeless</property>
                <property name="ShowNavigation" type="bool">False</property>
                <property name="ExportMode" type="exportmode">All</property>
                <property name="QuerySuggestionsSourceID" type="string" null="true" />
                <property name="InitialPrompt" type="string" null="true" />
                <property name="QuerySuggestionCount" type="int">5</property>
                <property name="ShowPeopleNameSuggestions" type="bool">False</property>
                <property name="ChromeState" type="chromestate">Minimized</property>
                <property name="AllowHide" type="bool">True</property>
                <property name="StatesJson" type="string">{}</property>
                <property name="RenderTemplateId" type="string" />
                <property name="Title" type="string">Search Box</property>
                <property name="Description" type="string">Displays a search box that allows users to search for information.</property>
                <property name="ServerInitialRender" type="bool">False</property>
                <property name="CatalogIconImageUrl" type="string" />
                <property name="MsBeforeShowingProgress" type="int">500</property>
                <property name="PageTitlePrefix" type="string" />
                <property name="ServerIncludeScriptsJson" type="string">null</property>
                <property name="TitleUrl" type="string" />
                <property name="AlternateErrorMessage" type="string" null="true" />
                <property name="ShowQuerySuggestions" type="bool">True</property>
                <property name="DefaultDropdownNodeId" type="int">0</property>
                <property name="SetFocusOnPageLoad" type="bool">False</property>
                <property name="ResultsPageAddress" type="string" null="true" />
                <property name="ShowAdvancedLink" type="bool">False</property>
                <property name="PersonalResultCount" type="int">3</property>
                <property name="TryInplaceQuery" type="bool">True</property>
                <property name="MaintainQueryState" type="bool">False</property>
                <property name="HelpUrl" type="string" />
                <property name="QuerySuggestionCompletionInterval" type="int">100</property>
                <property name="QueryGroupNamesJson" type="string">["Default"]</property>
                <property name="TitleIconImageUrl" type="string" />
                <property name="MissingAssembly" type="string">Cannot import this Web Part.</property>
              </properties>
            </data>
          </webPart>
        </webParts>
      </webpartxml>
      <webpartxml>
        <webParts>
          <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
            <metaData>
              <type name="Microsoft.Office.Server.Search.WebControls.ResultScriptWebPart, Microsoft.Office.Server.Search, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
              <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
            </metaData>
            <data>
              <properties>
                <property name="MaxPagesBeforeCurrent" type="int">4</property>
                <property name="ShowBestBets" type="bool">True</property>
                <property name="ShowViewDuplicates" type="bool">False</property>
                <property name="Height" type="string" />
                <property name="AdvancedSearchPageAddress" type="string">advanced.aspx</property>
                <property name="DataProviderJSON" type="string">{"QueryGroupName":"Default","QueryPropertiesTemplateUrl":"sitesearch://webroot","IgnoreQueryPropertiesTemplateUrl":false,"SourceID":"8413cd39-2156-4e00-b54d-11efd9abdb89","SourceName":"Local SharePoint Results","SourceLevel":"Ssa","CollapseSpecification":"","QueryTemplate":"*{searchboxquery}* (SPSiteURL:{{SiteCollectionUrl}} (((FileExtension:zip OR FileExtension:txt OR FileExtension:doc OR FileExtension:docx OR FileExtension:xls OR FileExtension:xlsx OR FileExtension:ppt OR FileExtension:pptx OR FileExtension:pdf)(IsDocument:\"True\")) OR (contentclass:\"STS_ListItem\" Path:\"{{SiteCollectionUrl}}/Lists/PageData_AK/*\")))","FallbackSort":null,"FallbackSortJson":"null","RankRules":null,"RankRulesJson":"null","AsynchronousResultRetrieval":false,"SendContentBeforeQuery":true,"BatchClientQuery":true,"FallbackLanguage":-1,"FallbackRankingModelID":"","EnableStemming":true,"EnablePhonetic":false,"EnableNicknames":false,"EnableInterleaving":true,"EnableQueryRules":true,"EnableOrderingHitHighlightedProperty":false,"HitHighlightedMultivaluePropertyLimit":-1,"IgnoreContextualScope":false,"ScopeResultsToCurrentSite":false,"TrimDuplicates":true,"Properties":{"ListId":"a354400b-e69f-4f15-90e3-0b76cf7dfa5a","ListItemId":16},"PropertiesJson":"{\"ListId\":\"a354400b-e69f-4f15-90e3-0b76cf7dfa5a\",\"ListItemId\":16}","ClientType":"","ClientFunction":"","ClientFunctionDetails":"","UpdateAjaxNavigate":true,"SummaryLength":180,"DesiredSnippetLength":90,"PersonalizedQuery":false,"FallbackRefinementFilters":null,"IgnoreStaleServerQuery":false,"RenderTemplateId":"DefaultDataProvider","AlternateErrorMessage":null,"Title":""}</property>
                <property name="AllowZoneChange" type="bool">True</property>
                <property name="UseSharedDataProvider" type="bool">False</property>
                <property name="ShowPreferencesLink" type="bool">True</property>
                <property name="EmptyMessage" type="string" />
                <property name="ScrollToTopOnRedraw" type="bool">False</property>
                <property name="ShowDefinitions" type="bool">True</property>
                <property name="SelectedPropertiesJson" type="string">["Title","Path","Description","EditorOWSUSER","LastModifiedTime","CollapsingStatus","DocId","HitHighlightedSummary","HitHighlightedProperties","FileExtension","ViewsLifeTime","ParentLink","FileType","IsContainer","SecondaryFileExtension","DisplayAuthor","PageDataTitle"]</property>
                <property name="CatalogIconImageUrl" type="string" />
                <property name="RepositionLanguageDropDown" type="bool">False</property>
                <property name="PreloadedItemTemplateIdsJson" type="string">["~sitecollection/_catalogs/masterpage/Display Templates/Search/Group_Default.js","~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Default.js","~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Site.js","~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Word.js","~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_PowerPoint.js","~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Person_CompactHorizontal.js","~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_BestBet.js","~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_WebPage.js"]</property>
                <property name="ResultsPerPage" type="int">10</property>
                <property name="EmitStyleReference" type="bool">True</property>
                <property name="ShowPaging" type="bool">True</property>
                <property name="ResultTypeId" type="string" null="true" />
                <property name="ShowUpScopeMessage" type="bool">False</property>
                <property name="AllowMinimize" type="bool">True</property>
                <property name="AllowClose" type="bool">True</property>
                <property name="HelpMode" type="helpmode">Modeless</property>
                <property name="Title" type="string">Search Results</property>
                <property name="ShowResults" type="bool">True</property>
                <property name="MaxPagesAfterCurrent" type="int">1</property>
                <property name="ShowResultCount" type="bool">True</property>
                <property name="Hidden" type="bool">False</property>
                <property name="ItemTemplateId" type="string">~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_CommonItem_Body_DigitalWorkPlace.js</property>
                <property name="ItemBodyTemplateId" type="string">~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_CommonItem_Body.js</property>
                <property name="UseSimplifiedQueryBuilder" type="bool">False</property>
                <property name="HitHighlightedPropertiesJson" type="string">["Title","Path","Author","SectionNames","SiteDescription"]</property>
                <property name="AvailableSortsJson" type="string">[{"name":"Relevance","sorts":[]},{"name":"Date(Newest)","sorts":[{"p":"Write","d":1}]},{"name":"Date(Oldest)","sorts":[{"p":"Write","d":0}]},{"name":"Lifetime Views","sorts":[{"p":"ViewsLifeTime","d":1}]},{"name":"Recent Views","sorts":[{"p":"ViewsRecent","d":1}]}]</property>
                <property name="ChromeState" type="chromestate">Normal</property>
                <property name="AllowHide" type="bool">True</property>
                <property name="AllowEdit" type="bool">True</property>
                <property name="StatesJson" type="string">{}</property>
                <property name="RenderTemplateId" type="string">~sitecollection/_catalogs/masterpage/Display Templates/Search/Control_SearchResults.js</property>
                <property name="ShowPersonalFavorites" type="bool">True</property>
                <property name="ShowSortOptions" type="bool">False</property>
                <property name="ChromeType" type="chrometype">None</property>
                <property name="AllowConnect" type="bool">True</property>
                <property name="HelpUrl" type="string" />
                <property name="ShowLanguageOptions" type="bool">True</property>
                <property name="Description" type="string">Displays the search results and the properties associated with them.</property>
                <property name="ServerIncludeScriptsJson" type="string">null</property>
                <property name="TitleUrl" type="string" />
                <property name="AlternateErrorMessage" type="string" null="true" />
                <property name="ShowAlertMe" type="bool">True</property>
                <property name="ShowDidYouMean" type="bool">True</property>
                <property name="QueryGroupName" type="string">Default</property>
                <property name="Width" type="string" />
                <property name="ShowAdvancedLink" type="bool">True</property>
                <property name="ExportMode" type="exportmode">All</property>
                <property name="Direction" type="direction">NotSet</property>
                <property name="BypassResultTypes" type="bool">True</property>
                <property name="GroupTemplateId" type="string" />
                <property name="TitleIconImageUrl" type="string" />
                <property name="MissingAssembly" type="string">Cannot import this Web Part.</property>
              </properties>
            </data>
          </webPart>
        </webParts>
      </webpartxml>
    </zone>
  </page>
⚠️ **GitHub.com Fallback** ⚠️