Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/sdk/PnP.Core/Model/SharePoint/Pages/Internal/Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1486,15 +1486,19 @@ private void LoadFromHtml(string html, string pageHeaderHtml)
}
else if (section.Columns.Count == 3)
{
if (section.Columns[0].ColumnFactor == 6)
// Use the first non-vertical-section column for type detection,
// as the vertical column (layoutIndex=2) may appear first in the list
var firstMainColumn = section.Columns.Where(c => c.LayoutIndex != 2).OrderBy(c => c.Order).FirstOrDefault();
var mainColumnFactor = firstMainColumn?.ColumnFactor ?? 0;
if (mainColumnFactor == 6)
{
section.Type = CanvasSectionTemplate.TwoColumnVerticalSection;
}
else if (section.Columns[0].ColumnFactor == 4)
else if (mainColumnFactor == 4)
{
section.Type = CanvasSectionTemplate.TwoColumnRightVerticalSection;
}
else if (section.Columns[0].ColumnFactor == 8)
else if (mainColumnFactor == 8)
{
section.Type = CanvasSectionTemplate.TwoColumnLeftVerticalSection;
}
Expand Down
Loading