Forum Discussion

Ivan54's avatar
Ivan54
Bronze Contributor
Mar 03, 2017

How to do a custom modern page library?

Hi, I could use some help with this.

I tried to create a custom document library (with extra metadata) and exchanging the default document content type with the modern website pages one. I even removed the document content type. All good so far.

But even though I click new > page and the modern authoring canvas opens, the page is not stored in my new custom library, but instead into the default one.

 

I was kind of trying to avoid messing with the default libraries. Any possible pitfalls by adding additional columns to the default pages library?

 

Anyone have some ideas?

  • I can confirm that adding additional metadata to the default Site Pages library doesn't work, either.  Looks like the Site Page content type is locked, because I can't add site columns to it :(

    • Christopher Johnson's avatar
      Christopher Johnson
      Brass Contributor

      UPDATE:

      I was, however, able to create a custom content type that inherits from the modern Site Page and add my own metadata to that.  I then added this content type to the Site Pages library, and can create instances of this content type.

       

      The caveat is that even if I create an instance of this content type, once I save the page, it's actually created as an instance of Site Page.  I then can update the content type of the item to my custom content type.  Definitely a bit buggy and not a great UX.

      • Max Goss's avatar
        Max Goss
        Brass Contributor
        Hi all,
        So using the approach outlined by Christopher I can create a page library with custom meta data. It's not too bad an experience to ask the site admin to edit the item, change the content type and apply my meta data. The question is, should we go down this route and build business logic based on extending the site page with a custom content type? My worry would be that this might get depreciated in a future ms release. Would be interested to hear thoughts on how people are trying to get around this modern page meta data limitation? Or are people resorting to no meta data / folders to group related pages?
        Thanks,
        -Max
    • Ivan54's avatar
      Ivan54
      Bronze Contributor
      My guess would be that the "+ Page" button is currently hardwired to the default SitePages Library and this may just be an unintended consequence of it.
      • If you find any guidance or documentation about how to achieve this, please share it here....but I tend to agree with you in regards of the no know consequences of customizing with new columns the Site Pages document libraries...my "classic" understanding of SharePoint tells me that you could do it with no problems...but we are in modern and Microsoft is re-using this document library on a per site basis

Resources