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

Forums / Developing with Sitefinity / Showing categories in hierarchical list

Showing categories in hierarchical list

9 posts, 6 answered
  1. Andreas
    Andreas avatar
    17 posts
    Registered:
    03 May 2013
    13 Jan
    Link to this post

    Hi

    I have some categories with subcategories under each one like this:

    Category1

        Category1.1

         CategoryCat1.2

    Category2

          Category2.1

    Category3

    When I use the categories widget all the categories is listed in a simple list and not a tree view like I would want. Dont find anything in the settings to accomplish this. 

    Any suggestions?

    Using Sitefinity 6.0

    Thanks in advance

    Best Regards

    Answered
  2. Andreas
    Andreas avatar
    17 posts
    Registered:
    03 May 2013
    02 Feb
    Link to this post
    Anyone?
    Answered
  3. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    30 Sep 2016
    05 Feb
    Link to this post
    Hi Andreas,

    In Sitefinity 8.2 displaying the categories in a hierarchical list can be easily achieved with the Feather Categories widget. Please refer to the below article for more details about this:

    http://docs.sitefinity.com/feather-add-hierarchical-tree-view-in-the-categories-widget

    Another option will be to use the attached sample where the Category Widget is extended to have a hierarchical view. You can test it by adding it to SitefinityWebApp project and then register it in the toolbox as explained in our documentation article here: http://docs.sitefinity.com/thunder-register-a-widget

    Regards,
    Sabrie Nedzhip
    Telerik
     
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  4. Andreas
    Andreas avatar
    17 posts
    Registered:
    03 May 2013
    05 Feb
    Link to this post

    Thanks for the reply.

    I've added the supplied classes to my project and added the widget on a page. I also added the regular categories widget on that page. The new extended widget does not display any categories though.

    I shouldn't replace the regular widget in the ViewMap like we have done with several other widgets like the searchbox. (In that case, what are the HostType for that widget?)

    Best Regards

    Answered
  5. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    30 Sep 2016
    09 Feb
    Link to this post
    Hi Andreas,

    Please make sure that you have properly set the categories widget to display the categories as it is described in this article from our documentation: http://docs.sitefinity.com/categories-widget

    Please open the widget designer and find the FieldName field and enter name of the classification field you would like to display. If you would like to display categories from the built-in Category classification please enter in the field Category.

    Then please find the TaxonomyId field and in this field paste the ID of the classification. In order to get the TaxonomyId of the classification you would like to display (for example category) you can refer to the below forum post and perform the steps from 3 to 6:
    http://www.sitefinity.com/developer-network/forums/general-discussions-/classification-doesn't-apply-in-custom-module-page#Z-fq7C0AokGzr89Uiu29FA

    After you copy the taxonomy id, open your custom widget and paste the copied Id in the TaxonomyId field.

    You may also refer to this article from our documentation where this is also described: http://docs.sitefinity.com/categories-widget

    You can also set the TaxaToDisplay field to All.

    If you would like to display all the categories, even these ones that are not assigned to any content type, in ShowEmptyTaxa field enter True. By default, the categories that have no items in them are not displayed.

    After performing the above the custom categories widget will properly show the categories in a tree view.

    Regards,
    Sabrie Nedzhip
    Telerik
     
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  6. Andreas
    Andreas avatar
    17 posts
    Registered:
    03 May 2013
    10 Feb in reply to Sabrie Nedzhip
    Link to this post

    Hmm, I don't have any of those fields in the widget. Only the standard.

    Answered
  7. Andreas
    Andreas avatar
    17 posts
    Registered:
    03 May 2013
    11 Feb in reply to Andreas
    Link to this post

    But when I try to add the fields required like I do when adding attibutes to other usercontrols It finds the fields and complains that i have to use override

            public override string FieldName { get; set; }
            public override System.Guid TaxonomyId { get; set; }

    So how do I make the fields appear inthe edit window?

    Answered
  8. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    30 Sep 2016
    15 Feb
    Link to this post
    Hi Andreas,

    I have just tested this in a Sitefinity 6.0 project and I can verify that the fields are present in the custom Taxonomy control which inherits from the TaxonomyControl class.

    I am sending attached a short video for your convenience demonstrating the results on my side (Categories_HierarchicalView.zip). As you can see in the video I have extracted in the root of my project solution the files attached to my reply from the 5th of February (I have also attached it to this ticket for your convenience - TaxonomyControlExtended.zip).

    Then I built the solution and registered the SitefinityWebApp.TaxonomyControlExtended control using Thunder.

    In the video I just demonstrated which is the control you need to register with Thunder. It was already registered in my project and this is why I pressed Cancel. You need to continue with the widget registration until Thunder says it is properly registered in the Toolboxes. Then restart the application in order for the changes to take effect.

    After performing the above you should be able to drop the custom TaxonomyControlExtended widget on a page. It should have the same properties in the designer as the built-in Categories widget - including the FieldName, TaxonomyId.

    Please download the attached custom taxonomy control and follow the steps from the video I have attached and it should work properly on your side.

    Regards,
    Sabrie Nedzhip
    Telerik
     
    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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  9. Andreas
    Andreas avatar
    17 posts
    Registered:
    03 May 2013
    16 Feb
    Link to this post

    Thanks, now it works.

    I added the control like I usually do by editing the toolbox.config manually.

    the difference that i can see is type which I wrote type="~/TaxonomyControlExtended.ascx"

    and thunder added

    type="SitefinityWebApp.TaxonomyControlExtended, SitefinityWebApp, Version=6.0.4200.0, Culture=neutral, PublicKeyToken=null"

    Best regards

    Answered
9 posts, 6 answered