Azure / Office 365 / SharePoint Development / Search

What makes a page to be a news page on SharePoint Online

on Oct 28, 2016 by Elio Struyf with 17 comments

Yesterday our tenant got the new team news functionality. This functionality allows you to write news in your team site which gets published on the homepage or via the new news headlines web part.

Team news functionality

Team news functionality

Info: SharePoint Online "team news" begins roll out to Office 365 First Release customers - https://techcommunity.microsoft.com/t5/SharePoint-Blog/SharePoint-Online-team-news-begins-roll-out-to-Office-365-First/ba-p/22763

As I started testing out the news page functionality. I questioned myself how they achieved it, because creating a new news page redirects you to the same URL as for creating a new site page.

Info: New page URL - https://tenant.sharepoint.com/sites/Team/SitePages/newpage.aspx?Mode=Edit

Both pages also look the same:

News page and site page layout

News page and site page layout

So, as they look and feel the same, where is the difference? You would think metadata, and this in fact true, but you cannot see it from the UI. If you would check the properties from the UI, you will only see its Title and Name. Now, when you open the content type of the page which is Site Page (also for the news pages). You will see the following metadata fields:

Site page content type

Site page content type

Here you find the answer. There are a couple of metadata fields which are hidden from the UI like Promoted State and First Published Date. When you check the contents of the ASPX page. You will see a couple of differences between the two types of pages.

News page

Site page

In the news page, you can find two important differences: PromotedState = 2.00000000000000 and the FirstPublishedDate which is defined.

A site page does not contain the FirstPublishDate element and the PromotedState value is set to 0.

So, what makes a page a news page?

As it turns out, the PromotedState value needs to be set to 2 to display it via the news headlines web part. When you change the number of the site page content, it will be displayed in the news headlines web part:

Promoting a site page to a news page

Promoting a site page to a news page

In the screenshot, you can see that my site page article now gets displayed, but something seems to be wrong with the date. This is where the FirstPublishDate fits in. When you add this to the content of the site page and refresh the homepage.

You will see a similar output:

Added the publish date

Added the publish date

I hope this gave you some insights into how the new news page functionality works behind the scenes.

Article comments

  • unnie ayilliath

    Good post. Is this webpart and news page feature available for non-team sites also?

    • On my environment, it is only available for the group team sites.

      • Larry Tenison

        I was able to jury-rig a pre-existing team site to use the new site page content type. I simply added a new site page to the Site Pages library, then swapped it in as home.aspx, and I now have a News page for my old team site.

  • Peter Cuttriss

    Great post Elio. Thank you for this insight. Just an FYI, I think you’ve got your Site Page and News Page code screen shots around the wrong way.

  • Hans Worst

    The URL behind the button ‘Add news’ is:
    ……./_layouts/15/CreateSitePage.aspx?source=%2Fsites%2Fmyfirstteam%2FSitePages%2FHome%2Easpx&promotedState=1
    so this default value for promotedState is not correct to let it show up as a news page.

    • In fact it is. When you create a news page, the initial value of the promotedState will be set to “1”. Like you show in the “add news” URL. This will be the draft version of your page and will stay draft until you publish the page. Draft versions aren’t displayed via the news web part. Once you publish a news page, the promotedState value will be set to “2”.

      • Hans Worst

        Ok, cool. But even if the news page is published the promotedState is zero and the FirstPublishDate isn’t filled out automatically (yet), so it won’t show up anyway, right?
        Do I miss something or is this a bug?
        Thanks!

        • It only checks the promotedState. When you create a new news page it should automatically get the promotedState value assigned. Are you experiencing something else?

  • Larry Tenison

    Great post, Elio. I have a general question. Does anyone know where those 3 default links in the News Headline web part are coming from? They all point off to Microsoft pages. Are they hard-coded some place? Can they be changed?

    • The web part contains a couple of hard-coded links to pages, so they are not changeable at this time.

  • Tomas Axell

    Great article!, but I was wondering where do you set the PromotedState=2 on the content on the page as you are talking about in the article?

  • Olivier Morel

    great article ! I posted several news but I would like to display an older news on the left side (same position as “Another site page” on the screenshot above. I can’t find how to do this. If I update the FirstPublishedDate in the aspx page is it going to work ? if yes how should I proceed to update it ? thanks!

    • Yes, it is based on the publish date. At the moment it seems that you cannot update it via the interface. You could download the aspx page, update its content and re-upload it to the site pages library. Updating it via PowerShell would be another option.