diff --git a/src/sdk/PnP.Core/Model/SharePoint/Pages/Internal/Page.cs b/src/sdk/PnP.Core/Model/SharePoint/Pages/Internal/Page.cs index 49c2dfc2ce..46c8c70d84 100644 --- a/src/sdk/PnP.Core/Model/SharePoint/Pages/Internal/Page.cs +++ b/src/sdk/PnP.Core/Model/SharePoint/Pages/Internal/Page.cs @@ -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; }