Configure

How to Hide the 'See All' Button in the Highlighted Content Web Part

This sample shows how to Hide the 'See All' Button in the Highlighted Content Web Part using PnP PowerShell

Summary

Recently, I encountered an issue with the "Show title and commands" toggle in the out-of-the-box Highlighted Content web part. It stopped working on both my development and customer tenant.

ToggleOff

While awaiting a resolution from Microsoft, I decided to find a workaround. That's when the PnP PowerShell cmdlet Set-PnPPageWebPart came to the rescue. The solution involves updating the PropertiesJson property of the web part.

powershell

# Connect to your SharePoint site
Connect-PnPOnline -Url "https://contoso.sharepoint.com/sites/Project" -Interactive

# Specify the page URL
$pageUrl = "ProjectHome.aspx"

# Get the page and its web parts
$page = Get-PnPClientSidePage -Identity $pageUrl
$webParts = $page.Controls | Where-Object { $_.Title -eq 'Highlighted content' } 

# Loop through each web part
foreach ($webPart in $webParts) {
        # Update isTitleEnabled property within PropertiesJson
        $jsonUp = $webpart.PropertiesJson.Replace('"isTitleEnabled":true','"isTitleEnabled":false') 
        
        Set-PnPPageWebPart -Page $pageUrl -Identity $webPart.InstanceId -PropertiesJson $jsonUp
    }

# Disconnect from the SharePoint site
Disconnect-PnPOnline

Source Credit

Sample first appeared on How to Hide the 'See All' Button in the Highlighted Content Web Part using PnP PowerShell

Contributors

Author(s)
Reshmee Auckloo

Disclaimer

THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

Tool documentation & references

Keep exploring