GitHub Icon Image
GitHub

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

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.

  • PnP 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

Check out the PnP PowerShell to learn more at: https://aka.ms/pnp/powershell

The way you login into PnP PowerShell has changed please read PnP Management Shell EntraID app is deleted : what should I do ?

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.

Back to top Script Samples
Generated by DocFX with Material UI