Create a custom content type for our modern pages. am i doing things correctly?

Steel Contributor

i am working on a classic online team site. and i want to add custom properties to our modern pages. now i do not want (in other words i can not) to directly add my custom properties to the built-in "Site Page" content type, because it is set as sealed. so i want to create a new custom content type and add the cusotm columns to it to, so i followed these steps:-

 

1. I created a new site content type named "my custom site page" which inherit from the built-in "Site Page" content type, as follow:-

 

s1.png


2. then i added my custom site column named "VPN" to the new custom content type as follow:-

 

s2.png


3. after that i added the custom content type to my "Site Pages" library.

4. Finally inside my "Site Pages" library, i changed the order of the content types, and i set my new custom content type as the first content type, which will set it as the defualt content type as follow:-

 

s3.png

 


s4.png
after that when i create a new modern page using the "Add a page" link:-

 

addapage.png

the new modern page will be automatically associated with my custom content type, and i can assign it the VPN value..so i am not sure if my above approach/steps are valid/supported to create cusotm content type for our modern pages?

2 Replies
To me is totally valid and supported...you are using content types in the way we are supposed to use them

@Juan Carlos González Martín wrote:
To me is totally valid and supported...you are using content types in the way we are supposed to use them

@Juan Carlos González Martín  yes i think i am in the right direction.. i would not ask this question about the validity of using custom content type, because i know it is valid.. but i asked this question since for a reason or another the built-in "Site Page" content type is sealed at our root site collection,, and my appraoch is a workaround to be able to add custom properties to our "Site Pages" library... if the "Site Page" content type was not sealed, then i could be sure that i can add my columns directly to it or create a custom content type (which in all ways is better, as generally it is not recommended to modify built-in components even if they are not sealed.).. i hope this clarify my case. and thanks for the reply.