How to assign multiple categories for an item

Posted by Community Admin on 03-Aug-2018 22:53

How to assign multiple categories for an item

All Replies

Posted by Community Admin on 24-Feb-2011 00:00

I have created recipe module based on Generic Content module.

For each recipe I need to assign different properties/category like  Flavor, Occassion etc..

There can be 1 to many values for each property.
e.g.
Recipe 1
Flavor: Sweet, tangy...
Occassion: Birthday, anniversary, holidays ...

Basically what I am looking for is similar to tag, but I need to be able to have a seperate tag for each property.

I was wondering if you could guide me as to how I can implement this functionality?  Once values are assigned recipes need to be searchable on those.


Thanks
Rajesh

Posted by Community Admin on 25-Feb-2011 00:00

Hey Rajesh,

I don't entirely know the answer to your question, but I'm intrigued with the problem.

--

My original thought was to use the CustomFields feature to add multiple Classifications:Category fields.  Then create a custom selector (as described here) to scope the selector for which categories could be selected.

Consequently your Category hierarchy could look something like this:

Flavor
-- Sweet
-- Tangy

Occassion
-- Birthday
-- Anniversary
-- Holiday

You would have custom selectors for each field (FlavorSelector, OccassionSelector) and these selectors would know which parent category to associate with.  The items these selectors would display would be children of the parent item.

--

All this being said, I tried to add a new CustomField to the Blogs Module.  I selected the type Classification:Category and received the following error:

The type Telerik.Sitefinity.Blogs.Model.BlogPost already contains a field with classification 'Categories' : 'Category'.

Each item can apparently only have 1 tag and category field associated with.  Although, a workaround might be to use a String field type and store the ID's associated with the selected Categories.

--

I'm just thinking out loud.  I'm not sure I said anything useful.  The Sitefinity team might have better suggestions.

Gabe Sumner
Telerik | Sitefinity CMS

Posted by Community Admin on 25-Feb-2011 00:00

Hello ,

Inside a given type you cannot have more than one type that uses the same classification. You can create a new classification and add the custom field inside it.

Regards,
Ivan Dimitrov
the Telerik team

This thread is closed