Automatic Sub Category Property Type
I had the need to categorize pages in several different “dimensions”, grouped as subcategories. I wanted to display these categories in different properties, but I didn’t want to display the whole category tree in each property (it’s quite large), or have the editor set all the dimensions in the same property. For this purpose I wanted to display only configurable part of the category tree.
This property type is a simple extension of the PropertyCategory which finds the subtree “root” based on the name of the property. Another way could have been to use the default value, but that only allows the numerical category ID which could be cumbersome to find.
So say I have a category tree which is [Root] – Dimensions – Technologies – [Available categories for technology here]. I then create a property called “Category-Technologies” (or “Category-14” if 14 is the ID of Technologies) of the sub category property type. Then only the subtree below Technologies will be displayed in edit mode. Neat, isn’t it?