Try our conversational search powered by Generative AI!

Episerver CMS 11.7.1: Add additional property to base pagetype in initialization


Is this even possible?

We have so many pages which inherits from our basepage type. Which cannot be modified or change. 

We want to add some additional fields to base apge so every page that inherits it gets it. Is it possible to do this in initalization isntead of doign it in admin view?

Sep 10, 2018 18:31


Why you can't modify base page class add those properties?

Sep 10, 2018 22:01

We have it in a separate project. Which cannot be modified. And because it is used by all our pages I would like to add the properties to the base page type.

Sep 10, 2018 22:21

You could do it but you would lose the ability to access the newly added property in a strongly typed way. You must be using the base type yourself, either to inherit in your own models or use directly in the views? If so then I would create a "extended base type" that inherits from your standard basepage type. Then change any references in your project from basepage type to use "extended base type". You can then add the properties you require and also access the new property(s) in a strongly typed way.

Otherwise if you really wanted do this in an init module (I would not advise you to do so) then you can modify the code here: and change line 37 to be your basepage type and add whatever properties you need there.


Edited, Sep 10, 2018 23:57
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.