现代页面现在位于Office 365的SharePoint工作组网站中,其中包括新的“team 新闻” facility. This 是 a simple way of creating 新闻 articles within a team site - it’s no replacement for an organization-wide intranet 新闻 facility, but it 是 对于团队在团队中传达新闻或其他信息很有用。虽然它’s called “news”,当然页面本身可以是任何东西–提醒团队,当前的优先事项/重点领域,政策和程序以及其他任何内容。一个关键要素是用户可以轻松地从他们的移动设备提交这些文章–特别是SharePoint移动应用。但它’只是一个页面,其中包含作者添加的文本,图像和任何其他Web部件(尽管这需要PC经验)。
I spent a little time looking 在 how all this works, and how developers and power users can query and search for such pages. Just to set the context since this 是 all shiny and new 在 the time of writing, this 是 what a display of team 新闻 looks like:
(顺便说一下,请原谅这个租户中的糟糕品牌-我用它来清楚地告诉我这是我的哪个测试租户!)
在组网站(即连接到Office 365组的现代网站)的上下文中,页面页眉/横幅看起来有些不同,但基本相同:
..然后放大一点“News headlines” control:
..或作为替代,“News list” control:
这两个都是新的Web部件,您可以将它们添加到现代页面中–并且由于可以将通过SharePoint框架开发的新型Web部件用于“classic” pages, it should be possible to use these new web parts everywhere. However, since 经典 pages use the old web part gallery and picker, it could be that we need to export and import one of these web parts to add them to a 经典 page.
General notes on 新闻:
- When a 新闻 page 是 created, it gets displayed on the site *立即* 在里面“News headlines” and “News list” controls –无需等待搜索爬网
- 发生这种情况是因为这些控件使用查询而不是搜索。在浏览器开发工具中,我们会看到对网站页面库的查询,如下所示: //chrisobriensp.sharepoint.com/sites/team1/_api/sitepages/pages/feed?promotedstate=2&published=true&$expand=CreatedBy,FirstPublishedRelativeTime
- It’请务必点击“Add” button next to 新闻 to create a 新闻 page. Otherwise you’会得到一个现代的页面,但它赢了’t show up as 新闻 - because it 是n’t a 新闻 page. As Elio points out in What makes a page be a 新闻 page in SharePoint Online?, 新闻 pages have a field called Promoted State and the value gets set to 2. 以便 晋升国=2 是 the thing that identifies 新闻 pages
- 请注意,这不是’不会暴露在用户界面中,因此’一旦创建页面(至少现在),就没有简便的方法(在代码/ PowerShell /工具之外)进行更新
- Images uploaded during 新闻 page creation go into Site Assets/Site Pages/[escaped page name], like this:
以便’s a sense of how team 新闻 works in team sites. But what if you want to search/query for these pages as a developer or power-user?
Searching for modern pages and 新闻 pages
Searching for 新闻 pages
我想在这里说的主要是扩展Elio’消息,并说还有一个具有相同名称的托管属性(“PromotedState”), and so we can use search to find these pages too (e.g. if we wanted to roll-up team 新闻 from 许多 sites):
..因此,对于Content Search Web部件或类似部件,我们可以在简单的查询中使用它来查找结果:
For now it seems only 新闻 pages use this property, but it might be wise to add a filter on say, content type, in case Microsoft decide to use it elsewhere 在里面future.
其他说明:
- 内容类型 是 the same for standard modern pages and 新闻 pages –详细信息如下:
- ContentType(名称)=“Site Page”
- ContentTypeId = 0x0101009D1CB255DA76424F860D91F20E6C411800D294F66E48650D4DB0D1477463DC0B51
- 所有Web部件的数据 是 stored in one page field 在里面content type,并将其转换为搜索中的一个托管属性–详细信息如下:
因此,将所有内容都存储在一个字段中的想法可能对现代页面构成挑战。它’无法轻易查询/过滤某些内容’存储在页面中,因为数据不存在’就像我们在发布场景中通常会在内容类型上分为不同的字段(例如,向我显示新闻类别=‘Politics’). That’我想这只是权衡因素,它具有现代页面的灵活性和简化的页面编辑体验– I’我不确定Microsoft在那儿有太多选择。
The JSON response from the _api/sitespages/pages/feed endpoint (which the 新闻 headlines/news list controls use behind the scenes) looks like this:
概要
The new modern pages are here, and the "team 新闻" feature in team sites 是 one example of their use. Developers and power-users will find it useful to understand what things look like underneath, and for 新闻 pages it's the 晋升国=2 field value (and managed property) that identifies them. Thanks to Elio for pointing out the field value, and consider also the managed property which may be useful to you in search.