Vue lecture

Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.
✇Ganesh Sanap Blogs

Update SharePoint Page Banner Image using PnP PowerShell

Using pages in SharePoint is a great way to share information or any news/announcement in your organization to SharePoint site users. SharePoint site pages can be improved by utilizing banner images in the page title area. Adding banner images to the page title area not only makes the page more visually appealing but also helps to convey the page’s purpose to the user more quickly and effectively.

In this blog post, we will see how to change the SharePoint Page Banner Image using PnP PowerShell.

First of all upload a high quality image in one of the document libraries in your SharePoint site. SharePoint site page banner images in title area look best when they are landscape or 16:9 or greater in aspect ratio, and when they are at least 1 MB in size. Check this Microsoft official documentation for recommended specifications for banner images: Image sizing and scaling in SharePoint modern pages

Then you can use below PnP PowerShell script to update the banner image at the top of the SharePoint online modern page:


# SharePoint online site URL
$siteUrl = "https://contoso.sharepoint.com/sites/wlive"	

# Connect to SharePoint online site  
Connect-PnPOnline -Url $siteUrl -Interactive

# Update SharePoint site page banner image
Set-PnPPage -Identity "Open-Door-Policy" -HeaderType Custom -ServerRelativeImageUrl "/sites/wlive/SiteAssets/work-remotely.jpeg"

Once you run above script successfully, you will find that banner image for your SharePoint site page is updated successfully:

Update SharePoint online modern page banner image in page title area using PnP PowerShell
Update SharePoint Page Banner Image using PnP PowerShell

Learn more

✇Ganesh Sanap Blogs

Update SharePoint Page Banner Image using PnP PowerShell

Using pages in SharePoint is a great way to share information or any news/announcement in your organization to SharePoint site users. SharePoint site pages can be improved by utilizing banner images in the page title area. Adding banner images to the page title area not only makes the page more visually appealing but also helps to convey the page’s purpose to the user more quickly and effectively.

In this blog post, we will see how to change the SharePoint Page Banner Image using PnP PowerShell.

First of all upload a high quality image in one of the document libraries in your SharePoint site. SharePoint site page banner images in title area look best when they are landscape or 16:9 or greater in aspect ratio, and when they are at least 1 MB in size. Check this Microsoft official documentation for recommended specifications for banner images: Image sizing and scaling in SharePoint modern pages

Then you can use below PnP PowerShell script to update the banner image at the top of the SharePoint online modern page:


# SharePoint online site URL
$siteUrl = "https://contoso.sharepoint.com/sites/wlive"	

# Connect to SharePoint online site  
Connect-PnPOnline -Url $siteUrl -Interactive

# Update SharePoint site page banner image
Set-PnPPage -Identity "Open-Door-Policy" -HeaderType Custom -ServerRelativeImageUrl "/sites/wlive/SiteAssets/work-remotely.jpeg"

Once you run above script successfully, you will find that banner image for your SharePoint site page is updated successfully:

Update SharePoint online modern page banner image in page title area using PnP PowerShell
Update SharePoint Page Banner Image using PnP PowerShell

Learn more

update-sharepoint-page-banner-image-using-pnp-powershell

ganeshsanapblogs

Update SharePoint online modern page banner image in page title area using PnP PowerShell

✇Marc D Anderson's Blog

Using Content Types in SharePoint’s Site Pages Library

In a modern SharePoint site, we only get one Site Pages library. We can’t create additional libraries which contain aspx pages which act like that special Site Pages library. If we could, we could meet a whole lot of interesting use cases, but it’s not an option.

One thing we *can* do is add additional Content Types to the Site Pages library. In many cases, I’ve seen people add a new column or two to the Site Pages library, but I don’t often see them adding additional Content Types. By using Content Types, you can take advantage of a richer information architecture which can span multiple sites, if needed.

Content Types are one of the primary building blocks for SharePoint, and I can’t gush about them enough. I do entire conference sessions just about Content Types! If you’re not using Content Types, you’re not holding SharePoint right, if you ask me.

I won’t go into how to create Content Types in general, but in this case, you’ll want to follow steps similar to this:

  • If the Content Type will be used only in the specific site (maybe a Benefits Overview in the HR site), then create the Content Type in the site. If there’s even a remote chance you’ll use the Content Type across sites (maybe Team Member Intro), then build it in the Content Type Hub in the SharePoint Admin Center.
  • To add a Content Type to the Site Pages library, you’ll most likely want to inherit from the out of the box Content Type called Site Page. This is the Content Type which is available in the Site Pages library by default.

In the example below, we’ve got three custom Content Types enabled on the Site Pages library: Productivity Tip, How To Guide, and Troubleshooting Guide. We’ve defined those Content Types at the tenant level: in the Content Type Gallery in the SharePoint Admin Center. Each of these Content Types inherits from an interstitial Content Type called Base [ClientName] Site Page, which inherits from Site Page. The reason we have the interstitial Content Type is so that we can say “show me all of the content which inherits from this Content Type”. That way, we can add additional peers to Productivity Tip, etc. without reconfiguring our result locations. We also have several Site Columns added to each of these Content Types so we can categorize the pages to improve findability.

Here’s what the Site Pages library looks like in one of our sites:

As you can see, the three custom Content Types are available there, and we can declare any Site Page as one of these special Content Types.

From here, we can use the PnP Modern Search Web Parts (my favorites!) to build powerful and sophisticated “slicing and dicing” for the content here or across multiple Site Pages libraries. But that’s a post for another day…

Caveats

  • If you change the Content Type of a page or set a column value, you’ve tacitly edited the page. That means you need to republish the page in order to make the change(s) visible – and even more importantly, to get the search crawler to pick up the change.
  • Because you’re adding Content Types into the Site Pages library, you may need to get creative with views in the library. At the very least, I generally change the default view from By Author (which is rarely helpful, anyway) to By Content Type. But build views which represent the tasks you want to complete: Pages which haven’t been reviewed, By Hardware Type, etc.
❌