|Number of votes:||9|
To set default values for page types and block types you need to override the PageData SetDefaultValues method.
We have a page type called ArticleList that have the following properties: SourcePage, MaxNumberOfPages and SortOrder. We want to have the source page default to the start page, the max number of pages to default to 5 and sort order to be alphabetical.
When the editor creates a new page of the type article list the property defaults will be loaded:
As you can see from the example you can also set defaults for the built in properties like visible in menu, child sort order, sort index and stop publish.
You can set defaults for blocks in the same way.
Default values set in admin mode are applied after the SetDefaultValues-method has been called and will thus override your default values defined in code. (Thanks for clearing this up Linus)