Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

How to assign the property value, based on the folder where the page is created



I wonder how, at the moment of page instance creation, how can I assign a value to some page's property, the value based on the folder name where this page instance is created?

Something related to '

public override void SetDefaultValues(ContentType contentType)'?

thank you

Dec 03, 2018 22:49

The SetDefaultValues method allows you to set default values for your content but this is executed before the content is saved in the repository. So you need to hook into the content created event: which would allow you to access the parent (folder) and update your content accordingly. You can do this in an Episerver intialisation module: 

Dec 03, 2018 23:11
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.