I'l like to add a custom mode property that I can use in my page types. In this example I would like to add a DropDownList and I would like to get the values for it from an SQL table. I've tried creating a property before and right now I've got about 11 of those in the list of properties.
First, how do I remove these?
Second, what is the "right way" to create a custom property? Feels like I must had done something wrong here since I get a whole lot of the same property even though I removed the code for it.
Go to admin mode, select 'Page Type' tab, click 'Edit Custom Property Types' in 'Manage Page Types' section and remove unnecessary properties types.
Most probably there will be different class names (namespaces / assemblies) from which the property types are loaded.
Just as you wrote how to delete them I found them, but thank you for the reply!
How come it created so many how them?
EPiServer browse your code for classes with [PageDefinitionTypePlugIn] attribute. If there is no property that matches to the found class (Assembly, Namespace, Classname have to be identical), the new property is created. So if you renamed your class couple times and moved it across 2 or 3 namespaces, every time the new property type was registered in EPiServer.
Hmm. I don't think I did that but I'm going to try again now that I've found how to delete them. Thanks for all your help!
How do I create a custom dropdownlist? I can't seem to find how I did it last time?
I right click in Visual Studio, choose to create a new item and choose "Custom property", right? DropDownList is not an option there.
Well a drop down isn't how the property is stored. It is stored for example as a string. The property presenter is however a drop down.
Check this blog post:
Once again I managed to find the answer just before someone posted it. Thanks though, I appreciate it!
When I'm in edit mode my drop down doesn't remember what I picked last time. I assume I need to override some function for it to get the stored value but which one?