I’m looking for a way to get the categories defined in the site directory of a portal programmatically. As far as I could see categories are represented as fields of the type ‘choice’ with multiple values the user can chose form.
My problem is, how could I distinguish category fields from normal fields like ‘title’ or ‘author’. Actually I don’t wan to hard code the categories names but want to load them dynamically. I think there have to be some criteria as the standard web part on the site directory page also loads the categories dynamically.
Unfortunately I couldn’t find many information about this problem.
Bye Flo
Ok, I see, I expressed myself not clearly. I know how to get the field schema form field. But I think after your post I got the answer my question myself.
The thing I wanted to know is, that I could assume that every field of the type ‘choice’ in the ‘websites’ list of the site directory represent a category a site could be assigned to? So every category field has to be of the type ‘choice’?
To get all available categories I have to iterate through the list’s fields and look for the fields based on the type ‘choice’, right?
UPDATE
Meanwhile I think I found an answer to my question. A column in the websites list is handled as a category of the web site directory if it part of the ‘categories’ view. In general category columns don’t have to be necessarily of the type ‘choice’, although other types don’t make sense in this context.