Pnpjs: Create a "news page" on SharePoint Online with @pnp/sp/clientsidepages ?

Created on 23 May 2019  路  4Comments  路  Source: pnp/pnpjs

Category

  • [X] Enhancement
  • [ ] Bug
  • [X] Question
  • [ ] Documentation gap/issue

Version

Please specify what version of the library you are using: [1.3.2]

Please specify what version(s) of SharePoint you are targeting: [SPO]

Expected / Desired Behavior / Question

How can I create a "news page" on SharePoint Online with @pnp/sp/clientsidepages ?
either with the method: sp.web.addClientSidePage or sp.web.addClientSidePageByPath

Observed Behavior

I can create site pages, but I want to create news pages.
It seems not possible to set the property: PromotedState to 2.
It would be nice if the methods to create site pages contained a way to specify if it is a site page or news page.

I appreciate your help with the above questions.

documentation answered question

Most helpful comment

There exists a promoteToNews method on the page, have you tried that?

All 4 comments

There exists a promoteToNews method on the page, have you tried that?

Hi Patrick.
Thanks for your quick answer, I will have a look at it.
Is it still in dev branch, and not released yet?

Just checked, it does appear that is not yet merged to master. Will aim to get a release out when I am back the first week of June. Thanks.

Closing this, just published latest version which includes the promote news method.

Was this page helpful?
0 / 5 - 0 ratings