Feb 16 2024 08:30 AM
Hi all! I had posted some news on my SP site and then associated the SP site with a hub. After adding a news web part to the hub, the news from the associated site correctly rolled up. However, after removing the SP site from the hub, I was expecting to see the news from the previously associated site disappeared from the hub site's news web part, however those news still show. Did anyone encountered this issue before or know how to solve it? Thanks!
Feb 19 2024 10:02 AM
Feb 19 2024 11:59 PM
Follow this Microsoft official documentation for manually reindexing the Site Pages document library as suggested by @SteveKnutson : Manually request crawling and reindexing of a site, a library or a list
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
Feb 20 2024 11:49 AM
Thank you @SteveKnutson and @ganeshsanap for the reply. I reindex'ed the Site Page library in the site that I removed from the Hub. The news from the site are still showing on the Hub 2 hours after the library being reinfex'ed. I will wait for another day to see if the news would stop showing and will let you know.
Feb 21 2024 08:49 AM
Feb 22 2024 10:17 AM
Feb 22 2024 10:34 AM
@KCLTW you can change the Promoteds State with JSON. Demoting a news article on the associated site should also remove it from the hub site. The JSON for demoting a news page is:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"flex-wrap": "wrap",
"display": "flex",
"flex-direction": "row"
},
"children": [
{
"elmType": "div",
"txtContent": "=if(@currentField == 0 ,'0 : Page' , if(@currentField == 1, '1 : Draft News' , if(@currentField == 2 , '2 : Published News','') ) )",
"style": {
"box-sizing": "border-box",
"padding": "4px 8px 5px 8px",
"display": "flex",
"border-radius": "16px",
"height": "27px",
"align-items": "center",
"white-space": "nowrap",
"overflow": "hidden",
"margin": "4px 4px 4px 4px",
"border": "1px solid",
"background-color": "=if(@currentField == 0 ,'#ffffff' , if(@currentField == 1, '#fffcec' , if(@currentField == 2 , '#dafffe','') ) )"
}
},
{
"elmType": "div",
"style": {
"font-size": "18px",
"cursor": "pointer",
"padding": "10px",
"border-radius": "50%",
"display": "=if(@currentField == 0 , 'none' ,'')"
},
"attributes": {
"iconName": "MoreVertical",
"class": "ms-fontColor-themePrimary ms-bgColor-themeLighter--hover"
},
"customCardProps": {
"openOnEvent": "click",
"directionalHint": "rightCenter",
"isBeakVisible": true,
"formatter": {
"elmType": "div",
"txtContent": "Demote (Change to 1: Draft News)",
"style": {
"padding": "10px 20px 10px 20px",
"cursor": "pointer"
},
"attributes": {
"class": "ms-bgColor-themeLighter--hover"
},
"customRowAction": {
"action": "setValue",
"actionInput": {
"PromotedState": "1"
}
}
}
}
}
]
}
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
Feb 23 2024 10:31 AM - edited Feb 23 2024 10:33 AM
Thank you @Rob_Elliott. It was my first time using JSON to change the column format and I thought it was a great learning opportunity. I actually applied the code from here so I would be able to change the promoted state back from 0 to 2.
I forgot to mention one thing - I would like the news posts still show up on the site that left the hub, since the news posts will still be relevant to the audiences with the site. So my goal is - after the site left the hub, news posts from the site should be- 1) removed from the hub; 2) staying with the site that left the hub
I think I don't really understand how SP hub site works. The action that seems to be the neatest and actually work is to manually unpublish the news page but leave the Promoted State as 2. By doing so the news still seemed to show up on the site, but disappear from the hub.
I tried to change the Promoted State to 0 using JSON- News posts disappeared from the site but still got stick in the hub's News web part. I have to also manually republish this page as a SP page and after this the post would disappear from the hub. If I then change the Promoted State back to 2 and leave it unpublished, the News would not show up on the hub. But if I republish it, the News would show back up again on the hub.
Good news is that the News page published after the site left the hub will not show on the hub, so I guess another thing I can try is to manually copy and publish the news page and delete the old one.