1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / How to assign multiple categories for an item

How to assign multiple categories for an item

3 posts, 0 answered
  1. Rajesh
    Rajesh avatar
    6 posts
    Registered:
    12 Nov 2010
    24 Feb 2011
    Link to this post
    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

  2. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    25 Feb 2011
    Link to this post
    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
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    25 Feb 2011
    Link to this post
    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
3 posts, 0 answered