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

Forums / General Discussions / Multiple TaxonomyControl's

Multiple TaxonomyControl's

6 posts, 0 answered
  1. emil makkar
    emil makkar avatar
    4 posts
    Registered:
    07 Jun 2004
    12 Oct 2011
    Link to this post
    Does Sitefinity 4.2 support multiple TaxonomyControl that operate on a single list. On the site i'm developing we have a list of documents, where each document is classified by different category hierarchies, say a Region category and a Division category. I want to be able to filter the document list by either or both of these categories.

    Any suggestion? 
  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    21 Aug 2017
    17 Oct 2011
    Link to this post
    Hello Emil,

    Yes this can be done.
    Add few categories to a document, then you can filter the download list widget based on those categories. I have attached a sample screenshot of the download list widget. You can select all categories you have or just a few.

    In case you need to add more classifications I will describe you the steps that need to be taken to add one new category.
    1. Go to Documents & Files module and click on Custom Fields(located in  the right sidebar)
    2. Create new custom field of type Classification and select one of the already available classifications, by default there are Categories, Tags, Departments. You can create new classification by going to Content->All Classifications and create a new one, it will appear in the dropdown when you create a new custom field or type Classification.
    3. Save the new custom field
    4. Edit one of the documents to add new classification to it.

    Greetings,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Emil
    Emil avatar
    3 posts
    Registered:
    13 Aug 2011
    18 Oct 2011
    Link to this post
    thanks Stanislav.

    If I were place two Taxonomy widgets on the page with the download list how can i sort the list as the user makes selections from either of the two taxonomy controls?
  4. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    21 Aug 2017
    20 Oct 2011
    Link to this post
    Hi Emil,

    The taxonomies controls have a functionality to filter based on only the selected taxonomy. For filtering based on multiple taxonomies you should create multiple taxonomy control.
    Here is a sample on the API that is needed to  get all taxonomies Guid`s and then filter them.
    var tagA_Id = new Guid("47F632AE-BAD3-4F57-B293-38AC1F3DCC0E");
               var tagB_Id = new Guid("BD1ECC6C-76F1-4538-804C-41DE67020C88");
               var tagC_Id = new Guid("35F312A1-A274-49BC-A8C2-606E3211B44D");
               var Cat1Id = new Guid("4B47DB31-F3EF-4040-9C95-58AC422B0EB5");
               var Cat2Id = new Guid("20CF96A4-852C-4CB9-9C60-84BDFF8CA0EA");
               var CatY_Id = new Guid("479D6F7B-D9D7-4E40-9A50-A9E2CF1CD039");
                 
               var content = App.WorkWith().BlogPosts().Where(bp => bp.Status == ContentLifecycleStatus.Live
                                                               && (
                                                                       (
                                                                            bp.GetValue<TrackedList<Guid>>("Tags").Contains(tagA_Id))
                                                                            && bp.GetValue<TrackedList<Guid>>("Tags").Contains(tagB_Id)
                                                                            && bp.GetValue<TrackedList<Guid>>("Tags").Contains(tagC_Id)
                                                                       )
                                                                   &&
                                                                       (
                                                                           bp.GetValue<TrackedList<Guid>>("Category").Contains(Cat1Id)
                                                                           || bp.GetValue<TrackedList<Guid>>("Category").Contains(Cat2Id)
                                                                       )
                                                                   &&
                                                                       (
                                                                           bp.GetValue<TrackedList<Guid>>("Category").Contains(CatY_Id)
                                                                       )
      
                                                                  ).Get().ToList();
      
               Grid1.DataSource = content;
               Grid1.DataBind();


    Kind regards,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Steve
    Steve avatar
    16 posts
    Registered:
    14 Jul 2010
    22 Nov 2011
    Link to this post
    This is exactly what I would like to do as well but am not sure where I should start.  I need to make a new frontend sidebar which lists the available categories, departments, and markets, that I will cause the product list to display all matching products.   What kind of control should I inherit from, TaxonomiesSidebar, DynamicCommandWidget?

    This control should have a couple dropdownlists, one for each classification.  Then that dropdown needs to databind to the list of values in that taxonomy.  And finally have a submit button that somehow communicates the selected values to the ProductList for the filtered list.

    Where can I find a walkthrough, video, or sample code to do each of these things?  I've been looking all day and this is the closest post I have found.

    thanks,
    Steve

  6. Webteam
    Webteam avatar
    28 posts
    Registered:
    30 Nov 2009
    30 Dec 2011
    Link to this post
    I am trying to do the exact same thing as Steve, multiple dropdowns based on categories that filter a list, in my case download list, and could also use a point in the right direction.
6 posts, 0 answered