Forum Discussion
Change default link to search in SharePoint online
- Jan 11, 2024
Hello arine1901
news posts are pages, there are saved in SitePages. But news posts have a promoted state 1 or 2, you can filter this property in your query. You can find more informations in this blog from Gregory Zelfond : https://sharepointmaven.com/news-post-page-vs-sharepoint-page-in-sharepoint-online/
Example:
{searchTerms} contentclass:STS_ListItem_WebPageLibrary AND RefinableString104:2
contentclass:STS_ListItem_WebPageLibrary >> only webpage libraries
RefinableString104:2 >> I have mapped ows_promotedstate to the RefinableString104
For sure, you can add more properties like PATH in your query.
Hope this helps.
Best, Dave
DaveMehr365 If we disable the status of the "All" tab, it will give error response because of the default link that launch first.
So, we have to always enable the "All" tab.
Now, I try to add a query for filtering the result only give the news post type.
What is the right ContentClass of the news?
Path:https://domain-name.sharepoint.com/sites/site-name IsDocument:1 FileExtension:aspx ContentClass:
is the query correct?
Thank you
Hello arine1901
news posts are pages, there are saved in SitePages. But news posts have a promoted state 1 or 2, you can filter this property in your query. You can find more informations in this blog from Gregory Zelfond : https://sharepointmaven.com/news-post-page-vs-sharepoint-page-in-sharepoint-online/
Example:
{searchTerms} contentclass:STS_ListItem_WebPageLibrary AND RefinableString104:2
contentclass:STS_ListItem_WebPageLibrary >> only webpage libraries
RefinableString104:2 >> I have mapped ows_promotedstate to the RefinableString104
For sure, you can add more properties like PATH in your query.
Hope this helps.
Best, Dave