Skip to content

Commit

Permalink
Merge of page extract updates. Thanks @czullu
Browse files Browse the repository at this point in the history
  • Loading branch information
bjansen committed Aug 16, 2024
1 parent 0d91ad9 commit 8941e3b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/lib/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Changed

- Update AuthenticationManager.cs for GCC (ie UsGovernment) Regions #1047, #1048 [SteveWinward - Steve Winward]
- Updated pages export logic to support the new page header model via full width page header web part [czullu - Christian Zuellig]

## [1.16.0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,16 @@ private void CreatePage(Web web, ProvisioningTemplate template, TokenParser pars
}
case ClientSidePageHeaderType.Default:
{
page.SetDefaultPageHeader();
//Message ID: MC791596 / Roadmap ID: 386904
if (clientSidePage.Sections.Any() && clientSidePage.Sections.First().Type == CanvasSectionType.OneColumnFullWidth &&
clientSidePage.Sections.First().Controls.Any(c => c.Type == WebPartType.PageTitle))
{
page.SetPageTitleWebPartPageHeader();
}
else
{
page.SetDefaultPageHeader();
}
break;
}
case ClientSidePageHeaderType.Custom:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,19 @@ public void ExtractClientSidePage(Web web, ProvisioningTemplate template, Provis
//if (pageToExtract.PageHeader != null && pageToExtract.LayoutType != Pages.ClientSidePageLayoutType.Topic)
if (pageToExtract.PageHeader != null && pageToExtract.LayoutType != PnPCore.PageLayoutType.Topic)
{
//All Headersettings are in the PageTitle WebPart. PageTitle-WP in first section as OneColumnFullWith (Message ID: MC791596 / Roadmap ID: 386904)
//need to fallback to default as we otherwise need to change xml schema
var headerType = ClientSidePageHeaderType.Default;
if (pageToExtract.PageHeader.Type != PnPCore.PageHeaderType.PageTitleWebPart)
{
headerType = (ClientSidePageHeaderType)Enum.Parse(typeof(ClientSidePageHeaderType), pageToExtract.PageHeader.Type.ToString());
}

var extractedHeader = new ClientSidePageHeader()
{
//Type = (ClientSidePageHeaderType)Enum.Parse(typeof(Pages.ClientSidePageHeaderType), pageToExtract.PageHeader.Type.ToString()),
Type = (ClientSidePageHeaderType)Enum.Parse(typeof(ClientSidePageHeaderType), pageToExtract.PageHeader.Type.ToString()),
//Type = (ClientSidePageHeaderType)Enum.Parse(typeof(ClientSidePageHeaderType), pageToExtract.PageHeader.Type.ToString()),
Type = headerType,
ServerRelativeImageUrl = TokenizeJsonControlData(web, pageToExtract.PageHeader.ImageServerRelativeUrl),
TranslateX = pageToExtract.PageHeader.TranslateX,
TranslateY = pageToExtract.PageHeader.TranslateY,
Expand Down

0 comments on commit 8941e3b

Please sign in to comment.