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.

Similar Posts

12 Comments

  1. I have also created news content types, which belong to Site Pages in modern SharePoint. The challenge is to differentiate them from regular pages, and I had to use templates. Do you have any experience with that?

    1. @Christophe:

      I think for news, using templates in the Site Pages library is a good way to go. If you want to use the IA, though, you can use Content Types. If you set the Content Type for a template, do pages based on that template inherit the Content Type? I haven’t had a need to try that.

      M.

      1. Quick update, I hit another roadblock because that template technique doesn’t address the case of news links. Exit content types for news, I am back to regular site columns.

  2. Hello Marc,

    I have created a custom Site Pages Content Type and added it to my Site Pages Library. However, I cannot figure out how to select the new Content Type as the Content Type for a new page. There is no way to add it to the New drop-down on the Site Pages Library or the New drop-down on the home page of the site. In your post, you say, “we can declare any Site Page as one of these special Content Types.” How do you declare a Site Page as a custom Site Page Content Type?

    1. @Katherine:

      I was just doing this today! I usually work in the Site Pages library and just change the metadata (including the Content Type) there. You can also create a Page Template from a page which already has that Content Type and just create new pages using that template.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.