Showing categories in hierarchical list

Posted by Community Admin on 04-Aug-2018 14:32

Showing categories in hierarchical list

All Replies

Posted by Community Admin on 13-Jan-2016 00:00

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

Posted by Community Admin on 02-Feb-2016 00:00

Anyone?

Posted by Community Admin on 05-Feb-2016 00:00

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
 

Posted by Community Admin on 05-Feb-2016 00:00

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

Posted by Community Admin on 09-Feb-2016 00:00

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
 

Posted by Community Admin on 10-Feb-2016 00:00

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

Posted by Community Admin on 11-Feb-2016 00:00

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?

Posted by Community Admin on 15-Feb-2016 00:00

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
 
[View:/cfs-file/__key/communityserver-discussions-components-files/296/9e1eba25_2D00_ffdc_2D00_4470_2D00_a3d9_2D00_540c738effbd_5F00_TaxonomyControlExtended.zip:320:240]
[View:/cfs-file/__key/communityserver-discussions-components-files/296/edc61ff3_2D00_6db2_2D00_48e5_2D00_b472_2D00_979ad2b3f70f_5F00_Categories_2D00_HierarchicalView.zip:320:240]

Posted by Community Admin on 16-Feb-2016 00:00

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

This thread is closed