Vue normale

Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.
À partir d’avant-hierFlux principal

News Post Stuck in Hub Site’s News Web Part Even After Deletion

This is something that’s happened to me in multiple tenants recently. When I delete a News Post which I’ve created in a Hub Site, the post never goes away in the News Web Part. It always seems to be a post we’ve created as some sort of point-proving demo, too. You know, with a title like: “This would be a really helpful news post” or “Be sure to delete me.”

Was there a trick was missing? I’ve tried reindexing, emptying the recycle bin, everything I could think of, but no joy.

The light finally came on when I posted to #SPHelp on Twitter and got this response from my pal Sharon Weaver (@shareoneweaver).

I solved this problem by changing the promoted state to 0. Show promoted state field in view, edit and save it with no changes, and then change the value from 2 to 0. Voila. Then just hide the field again. Need to make a blog post but haven’t had a chance. 😉

— Sharon Weaver (@sharoneweaver) March 22, 2022

When PromotedState is 2, the page is a News Post. When it’s 0, the page is just a page. So, in effect, you want to remove the “newsiness” from the page. Then you can get rid of it with impunity.

Thing is, you can’t edit PromotedState through the UI anymore. But I had a solution!

No surprise, but ShareGate to the rescue. I exported the metadata for the page, edited PromotedState value from 2 to 0 in Excel, imported the change to PromotedState, manually kicked off a reindex of the library – and the pesky News Post is gone from the News Web Part!

Not trivial, but it worked. It’s a bug.

Filtering SharePoint News Pages with Metadata

This is a quick tip about a SNAFU which caught me up today. I got to do a “Doh!” in front of a client, which is always fun. Hopefully this will save you the same embarrassment.

Home Simpson saying "Doh!"

Filtering News pages based on some metadata applied to the pages is a thing, and has been for a good, long time. I knew it should work, and pretty easily at that.

When I was on the call, I had added a metadata column to the Site Pages library. Simple. I went and put the page with the News Web Part into edit mode and looked in the Filter section for Page properties. No joy. Instead I was seeing:

Managed Properties are awesome, and I set them up all the time so I can build search-driven solutions, usually with the PnP Modern Search Web Parts, which, as I’ve said before, are the bees knees. But I knew there should be an option to filter based on Page properties instead. Had something changed? Was it better? I wasn’t sure.

I fired up my MVP communication channel and asked if things had indeed changed. As I expected, Susan Hanley (@susanhanley) responded almost right away.

Look to see what the Source is for News. When it is a single site (i.e., the site you are on), you can filter using Page properties. When you are selecting news from multiple sites, you will not see the Page Properties option – just Managed property.

Doh! I hadn’t even though to check that setting! A simple change at the top of the News Web Part properties to use This site as the source, and Page properties was back where I expected it.

This makes sense if you think about it. The Page properties in Site Pages libraries probably wouldn’t be consistent across multiple sites, so Managed properties makes more sense. Within one site, the Site Pages library is a single source, so has to be consistent with itself.

I do think there could be some in-Web-Part assistance for this with a slightly better UI, though. Maybe just an info bubble like the Enable audience targeting section right below it?


As you might expect, Greg Zelfond (@gregoryzelfond) has a great post about all this if you want to understand it better:

How to manage categories of news using custom metadata – SharePoint Maven

❌
❌