Replies: 1 comment
-
I have exactly the same issue. Every page without an HTML Table has been converted to Modern without a problem, and it seems acceptably good, but pages with HTML are completely broken : Tables are exceeding the width of the page, CSS is messed up and images are wrongly placed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We are currently in the process of migrating some classic publishing pages from on-prem SP2013 into SPO and modernising them. A lot of these pages contain HTML tables, particularly HTML tables with images inside.
Whenever we try to use ConvertTo-PnPPage on these pages, they copy successfully, but there is no page content. However, if we convert them using a custom -PageLayoutMapping containing:
<Field Name="PublishingPageImage" TargetWebPart="SharePointPnP.Modernization.WikiImagePart" Row="1" Column="1"> <Property Name="ImageUrl" Type="string" Functions="ToImageUrl({PublishingPageImage})" /> <Property Name="AlternativeText" Type="string" Functions="ToImageAltText({PublishingPageImage})" /> <Property Name="Anchor" Type="string" Functions="ToImageAnchor({PublishingPageImage})" /> <Property Name="Caption" Type="string" Functions="ToImageCaption({PublishingImageCaption})" /> </Field> <Field Name="PublishingPageContent" TargetWebPart="SharePointPnP.Modernization.WikiTextPart" Row="3" Column="1"> <Property Name="Text" Type="string" /> </Field>
The page content copies over successfully, but with incorrect formatting. It bolds all text on the page, leaves broken URL references on the images within the page body to the PublishingImages folder on the target site (as those images haven't been converted over to the site), and then adds the images to the bottom of the page in a separate image web part rather than in the main content body.
I would be surprised if the conversion couldn't correctly handle HTML tables, so I can only assume that we are making incorrect use of the mapping files, but I'm not sure what we're doing wrong.
Any help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions