CategoryTree
Hi,
I have recently moved from SF3.7 to SF4.0 and have found that there is no longer a CategoriesTree, which you can combine with a DownloadList, to get a directory style file download thing going on.
Is there anything similar in SF4.0 that I can use instead and how would i go about implementing it?
Thanks in advance!
Regards,
George
Hello George,
You can use Categories widget from "Classifications" widget section.
All the best,
Ivan Dimitrov
the Telerik team
Hi Ivan,
Thanks for the quick response, i thought this would probably be it, however when i drag the widget onto a page it says, 'You are trying to access item that no longer exists. The most probable reason is that it has been deleted by another user.'. Is there some field i am filling in wrong in the settings?
Thanks,
George
Hi George,
Have you set any properties of the control or this happens right after you drop it on a page. Can you replicate the issue using our demo.
Make sure that you are using the official release of Sitefinity 4.0 .
You can also try to recreate your categories and tags if you have not used them.
Best wishes,
Ivan Dimitrov
the Telerik team
Hi,
I have fixed the issue with the error that was displaying, however it displays all categories as a list. I have seen that the only set options for 'RenderAs' are VerticalList, HorizontalList and Cloud ... is there not an option to have it display as a tree, using the RadTreeView say?
Thanks,
George
Hello George,
We do not have a public control that will render the categories as RadTreeView. It should be a custom control - RadTreeView that is bound to a datasource of categories.
sample
var manager = TaxonomyManager.GetManager();
var taxonomy = manager.GetTaxonomy(TaxonomyManager.CategoriesTaxonomyId);
var taxa = taxonomy.Taxa;
foreach
(HierarchicalTaxon t intaxa)
// here you can use t.Parent and
// t.Subtaxa
var evaluator =
new
TaxonomyEvaluator();
var taxonBuildOptions = TaxonBuildOptions.None;
if
(
this
.Taxonomy
is
HierarchicalTaxonomy)
taxonBuildOptions = TaxonBuildOptions.Hierarchical;
elseif(
this
.Taxonomy
is
FlatTaxonomy)
taxonBuildOptions = TaxonBuildOptions.Flat;
var evaluatedResult = evaluator.BuildUrl(
this
.Taxonomy.Name, taxon,
"Category"
, taxonBuildOptions,
"UrlPath"
,
null
);
Thanks Ivan for your reply,
I will have a look at this, however two things:
- I am using Telerik.Sitefinity.Taxonomies and Telerik.Sitefinity.Taxonomies.Model but Taxonomy is complaining that there is no definition for it..?
- And what is the datasource i have to use? Apologies I am very new to this taxonomy stuff!
Thanks,
George
Hello,
manager.GetTaxonomy returns ITaxonomy. From this ITaxonomy you get the taxons. For example you have a taxonomy of type HierarchicalTaxon and inside this ITaxonomy you have items - hierarchical taxons. The Taxa returns IEnumerable<ITaxon> which you have to bind to your control. This is the datasource you need to build.
Best wishes,
Ivan Dimitrov
the Telerik team