When publishing news in a Group site it will showcase it under News (like this) what is the logic behind this??
In here it will publish only the news. Even if I create a page. It won't show there.
I need a code clarification.
If you download both pages and inspect the contents, you will find that in the news page , you have PromotedState
value as 2.
The contents in the news page are as below:
<mso:PromotedState msdt:dt="string">2.00000000000000</mso:PromotedState>
Where as in case of site page, its is as below:
<mso:PromotedState msdt:dt="string">0</mso:PromotedState>
Right now, you can only provision news page via the news list/news headlines webpart (not sure programmatically). If you create it via Site Contents > Site Pages, it will create a simple site page only which wont be visible inside news webpart since the PromotedState
value is 0 in its case.
Reference - What makes a page to be a news page on SharePoint Online