Forum Discussion

Priscilla1207's avatar
Priscilla1207
Copper Contributor
Nov 04, 2022

News post does not appear on home page

I'm quite new to this, so please correct my knowledge if needed! 

 

I add new story using news post. But when I publish it. It doesn't show up on the home page nor the 'News Archive' page. I have to add it manually using news link. According to my colleague, they have always been doing it manually like that, but from what I understand, the news article should automatically appear on the main page at least. I don't know what they did, but is there a way for the story to automatically appear on the main page?

  • YaYa's avatar
    YaYa
    Copper Contributor

    For my part, the user had created a simple site page instead of a news post. I noticed this by checking the "Promoted State" column, which was set to 0 instead of 2, and the "First Published Date" column, which was empty. I then had to run my script, which converted the page into a news post and made it appear on the homepage.

    Connect-PnPOnline -Url "xxxx" `
        -ClientId "xxxxx" `
        -Tenant "xxxxx" `
        -CertificatePath "xxxxx"
    
    $page = Get-PnPListItem -List "SitePages" -Query "<View><Query><Where><Eq><FieldRef Name='FileLeafRef' /><Value Type='Text'>xxxxx.aspx</Value></Eq></Where></Query></View>"
    Set-PnPListItem -List "SitePages" -Identity $page.Id -Values @{"PromotedState"=2}
    
    $utcDate = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
    Set-PnPListItem -List "SitePages" -Identity $page.Id -Values @{"FirstPublishedDate" = $utcDate}

     

  • Priscilla1207

    Sounds like you're are having issues with the indexation of that SharePoint library, that's why the News doesn't show up automatically

    Go to SitePages -> Cog -> Library Settings -> more library settings -> advanced settings -> Reindex Document Library

    This will force the search engine to index library and your news should show up 🙂
  • Priscilla1207 Can you check and confirm if you are using SharePoint out of the box news web part? 

    DocumentationUse the News web part on a SharePoint page 

     

    Can you check if the "Require approval" settings are enabled on "Site Pages" library (where news pages are stored)?

    DocumentationRequire approval of items in a list or library 


    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.

  • RobElliott's avatar
    RobElliott
    Silver Contributor

    Priscilla1207 each published news item should appear in the news web part on your home page providing you've clicked on the add link and selected news post

     

    So there are a few things to check. Edit the web part and make sure you have selected the source of the news stories. If you have a hub site with associated sites you would select all sites in the hub, but if not or while you are testing this just select this site.

     

     

     

    Further down the right hand pane, make sure you haven't got anything strange in the Organise section. Unless you want to pin a news story you would normally leave everything at automatic.

     

    In your site pages library, once you've published a news story show the Promoted State column in your view and make sure the Promoted State is 2 which means it's a published new story - 1 is a draft page and 0 is a published normal page. If it's showing 0 go to the page and click the Promote link at the top of the page which will promote it to a published news story.

     

     

    Rob
    Los Gallardos
    Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)

     

Resources