Skip to content

Commit

Permalink
Pages that removed the full width section and the banner web part and…
Browse files Browse the repository at this point in the history
… therefore have no page title anymore do not get a page title when being updated #1550
  • Loading branch information
jansenbe committed Nov 18, 2024
1 parent 85d87a6 commit f1630bc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Removed support for .NET 6 and .NET 7 as they are out of support [gautamdsheth - Gautam Sheth]
- Fixed to the issue where users were getting added to User Info list instead of a SharePoint group. #1577 [czullu - Christian Zuellig]
- Modern Page Title in OneColumnFullWithSection also allowed in TEAMCHANNEL Sites #1564 [czullu - Christian Zuellig]
- Pages that removed the full width section and the banner web part and therefore have no page title anymore do not get a page title when being updated #1550 [jansenbe - Bert Jansen]

## [1.14]

Expand Down
8 changes: 7 additions & 1 deletion src/sdk/PnP.Core/Model/SharePoint/Pages/Internal/Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,13 @@ public async Task<string> SaveAsync(string pageName = null)
// Persist the page header
if (pageHeader.Type == PageHeaderType.None)
{
PageListItem[PageConstants.PageLayoutContentField] = SharePoint.PageHeader.NoHeader(pageTitle);
// Only set the page header to "old" empty page header when there's no one column full width section present. A one column full width section
// with a banner web part is considered to be a page header
if (sections.Any(s => s.Type == CanvasSectionTemplate.OneColumnFullWidth) == false)
{
PageListItem[PageConstants.PageLayoutContentField] = SharePoint.PageHeader.NoHeader(pageTitle);
}

if (PageListItem.Values.ContainsKey(PageConstants._AuthorByline))
{
PageListItem[PageConstants._AuthorByline] = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ public void FromHtml(string pageHeaderHtml)
}
}
}
else
{
Type = PageHeaderType.None;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public enum PageHeaderType
Custom = 2,

/// <summary>
/// All Headersettings are in the PageTitle WebPart. PageTitle-WP in first section as OneColumnFullWith (Message ID: MC791596 / Roadmap ID: 386904)
/// All Headersettings are in the PageTitle WebPart. PageTitle-WP in a section as OneColumnFullWith (Message ID: MC791596 / Roadmap ID: 386904)
/// </summary>
PageTitleWebPart = 3,
}
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/PnP.Core/Model/SharePoint/Pages/Public/IPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public interface IPage
public void AddControl(ICanvasControl control, ICanvasColumn column, int order);

/// <summary>
/// Removes the set page header
/// Removes the set page header by setting the page banner web part to "Plain" mode
/// </summary>
public void RemovePageHeader();

Expand Down

0 comments on commit f1630bc

Please sign in to comment.