Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you. Thanks!
[ ] Bug
[X] Enhancement
[ ] Page Transformation: Error during the setup/use of the Page Transformation UI solution (did you check our troubleshooting guide?)
[ ] Page Transformation: Error during the use of page transformation from PnP PowerShell
[ ] Page Transformation: Error during the use of page transformation from .Net
[X] Page Transformation: Page is not looking correct after transformation
[ ] Modernization Scanner: something went wrong...
If a converted Summary Links web part has no links it should be hidden link a new Quick Links web part would be. I also wouldn't mind an option to have them deleted.
Summary Links web parts are converted to Quick Links web parts. If a new Quick Links web part has no links it is hidden. When a Summary Links web part only has the sample links (Link 1, Link 2, Link 3) they show up as legitimate links and an empty Quick Links web part is shown.
Create a Summary Links web part in a classic page. Do not add any links to it. Convert the page.
Good suggestion @ToddKlindt, thanks for sharing it. Will have a look a this one before the upcoming September release.
Hey @ToddKlindt : I'm not able to repro or maybe I don't fully understand the issue here. When I've empty summary links web parts (either in the page layout or added as web part afterwards) they're transformed to default quicklinks web parts, which are not visible since there's no links in them.
Hi @ToddKlindt ,
If you have more information to clarify this issue then please let me know.
Closing this one per our discussion today. If there's values in the source web part we can't consider it empty. You could opt to not convert this at all by removing that field from the webparts zone in the page layout mapping, but then it applies to all pages converted using that page layout mapping
@jansenbe - @ToddKlindt and I have been working on this together. I think the issue is because SummaryLinksWebParts always have Link 1, Link 2, and Link 3 (when you add them to a classic publishing page), they are never actually "empty".
In this case, if we could somehow explicitly NOT convert that Web Part (in the page layout where we are working), then we could solve the problem that way.
I don't really understand what you say above: " You could opt to not convert this at all by removing that field from the webparts zone in the page layout mapping, but then it applies to all pages converted using that page layout mapping"
What's the general way to NOT convert a Web Part? We're not understanding the WebPartZones section well enough.
In your example:
<WebPartZoneLayout>
<WebPartOccurrence Type="Microsoft.SharePoint.WebPartPages.ContentEditorWebPart, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Row="3" Column="2"/>
<WebPartOccurrence Type="Microsoft.SharePoint.WebPartPages.ContentEditorWebPart, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Row="3" Column="1" Order="2"/>
<WebPartOccurrence Type="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart, Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Row="3" Column="1" Order="1"/>
</WebPartZoneLayout>
But neither of those Web Part Types are available in modern, so what purpose does this serve? What if we DIDN'T want to convert on of those Web Parts?
Just now saw your comment @sympmarc . You can only "not" convert when it's a summarylinks field, if it's a web part then things are different. Let me re-evaluate the options here and see if I can do something for next release.
Hi @sympmarc / @ToddKlindt,
I did do some more research on this and can't repro getting a summarylinks web part or field to show with default values. I guess that in your environment this was handled by customization somehow...unless this was something default in 2010 time frame? I've tested with 2013 and SPO.
Given the above I think the current approach you're using (remove the transformed web part from the page) is a good option. An alternative option would be to keep a "special" version of the webpartmapping.xml file in which you configure the summarylinks web part to not transform at all...this will trigger all transformation runs using this webpartmapping.xml file to skip this web part. If you're confident you want to drop this works, if you only want to drop when the "default" values are present this will not work.
Hi @sympmarc / @ToddKlindt,
Hi!
Given the above I think the current approach you're using (remove the transformed web part from the page) is a good option. An alternative option would be to keep a "special" version of the webpartmapping.xml file in which you configure the summarylinks web part to not transform at all...this will trigger all transformation runs using this webpartmapping.xml file to skip this web part. If you're confident you want to drop this works, if you only want to drop when the "default" values are present this will not work.
For my situation, this would work. Can you point me to documentation on how to remove or skip a web part during transformation? The web part isn't specifically called out in the XML, so it's not just a matter of deleting the rows. At least not as far as I can tell.
First grab the webpartmapping.xml file that belongs to your version:
Export-PnPClientSidePageMapping -BuiltInWebPartMapping -Folder c:\temp
In that file replace below section
<!-- Summary Link web part -->
<WebPart Type="Microsoft.SharePoint.Publishing.WebControls.SummaryLinkWebPart, Microsoft.SharePoint.Publishing, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" CrossSiteTransformationSupported="true">
<Properties>
<!-- Contains the html representation of the links -->
<Property Name="SummaryLinkStore" Type="string" Functions="{FullPath} = Concatenate({Host}, {Web});{EncodedWeb} = HtmlEncodeForJson({FullPath});"/>
<Property Name="ChromeType" Type="integer"/>
<Property Name="Xsl" Type="string"/>
<Property Name="QuickLinksJsonProperties" Type="string"/>
</Properties>
<Mappings Selector="SummaryLinkSelector({SummaryLinksToQuickLinks})">
<Mapping Name="UseText" Default="true" Functions="{CleanedText} = TextCleanUpSummaryLinks({SummaryLinkStore},{ChromeType},{Title})">
<!-- Summary links html is tranformed to html that be presented using the text editor -->
<ClientSideText Order="10" Text="{CleanedText}"/>
</Mapping>
<Mapping Name="UseQuickLinks" Default="false" Functions="SummaryLinksToQuickLinksProperties({SummaryLinkStore},{QuickLinksJsonProperties})">
<!-- Summary links html is tranformed to the quicklinks web part -->
<ClientSideWebPart Type="QuickLinks" Order="10" JsonControlData="{"serverProcessedContent":{"htmlStrings":{},"searchablePlainTexts":{"title":"{Title}"{SearchablePlainTexts}},"imageSources":{{ImageSources}},"links":{"baseUrl":"{EncodedWeb}"{Links}},"componentDependencies":{"layoutComponentId":"706e33c8-af37-4e7b-9d22-6e5694d92a6f"}},"dataVersion":"2.1","properties":{JsonProperties}}"/>
</Mapping>
</Mappings>
</WebPart>
with
<!-- Summary Link web part -->
<WebPart Type="Microsoft.SharePoint.Publishing.WebControls.SummaryLinkWebPart, Microsoft.SharePoint.Publishing, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" CrossSiteTransformationSupported="true">
<Properties>
<!-- Contains the html representation of the links -->
<Property Name="SummaryLinkStore" Type="string" Functions="{FullPath} = Concatenate({Host}, {Web});{EncodedWeb} = HtmlEncodeForJson({FullPath});"/>
<Property Name="ChromeType" Type="integer"/>
<Property Name="Xsl" Type="string"/>
<Property Name="QuickLinksJsonProperties" Type="string"/>
</Properties>
<Mappings>
<!-- Drop summarylinks webparts -->
<Mapping Default="true" Name="default"></Mapping>
</Mappings>
</WebPart>
Save the updated webpartmapping.xml file and pass it along in the ConvertTo-PnPClientSidePage cmdlet using the -WebpartMappingFile parameter.
Closing this one again @sympmarc / @ToddKlindt . You know how to find me if you need help to the above explained approach to work :-)
I've used it a couple of times and it seems to work as advertised. :)