TransWikia.com

How to set thumbnail image and page description for sharepoint modern pages using pnpjs?

SharePoint Asked by Prathyush P on October 25, 2021

I’m trying to set thumbnail image and page description programmatically using pnpjs. By default it is picking banner image as thumbnail image and first paragraph in page as page description. How can i update those fields?

enter image description here

One Answer

You can have a try below method to update thumbnail image and page description programmatically:

const page = await sp.web.loadClientsidePage("/sites/s01/SitePages/getcontrol.aspx");       
  page.description = "iam new desc";
  page.bannerImageUrl = "https://abc.sharepoint.com/sites/s01/testlib/Pictures/1.jpg";

  page.save();

More Reference:

BR

Answered by Baker_Kong on October 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP