Custom Property in CMS 5, category selection

Vote:
 
Hi, In edit mode I want to show a part of the categories, let's say everything under a category named Services. I've tried to use the EPiServer.Web.PropertyControls.PropertyCategoryControl but it shows all categories, I only want to show the sub categories under Services in order not to confuse the editors too much. Do you have any suggestions? I've tried to make my own custom property and inherit from the EPiServer.Web.PropertyControls.PropertyCategoryControl, but I don't know which method to override in order to create the part of the categoires I want. I'm looking for the easy way :-) I don't want to re-invent the wheel. Can any one help?
#15926
Mar 25, 2008 19:07
Vote:
 
Hi Kenneth! Unfortunately this is not possible to do today except by creating the category-tree yourself. There is a method in the class PropertyCategory that defines the list of categories but this is not used to present the edit UI in the R1 release. We have changed this behaviour so that this will be possible by just defining the selectable categories but this will not make it to the SP1 release so it will probably be in the R2 release next year. If you really want to do it now I suggest to have a look at the implementation of CreateChildControls in InputCategoryTree in .NET reflector.
#16649
Mar 25, 2008 19:12
Vote:
 
Hi Kenneth, A while ago I was working on making a code-sample that did exactly what you're requesting. I succeeded in making a control that shows a part of the category tree as a drop-down list - but I got stuck at having that custom control saving it's settings in the page-category property which turned out to be a lot more difficult than I had imagined. However it should be pretty simple to save the selection in a property of it's own. I'll be happy to try to dig up my code for you if you're still interested. Happy New Year, Allan
#16650
Mar 25, 2008 19:12
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.