Forums / Setup & design / Best practice for creating a hierarchical category tree?

Best practice for creating a hierarchical category tree?

Author Message

Robb Shecter

Tuesday 25 March 2008 6:27:59 pm

Hi,

I need to create a small hierarchies of categories which I can then apply to other objects in a new class I have yet to make. Is there a data type or content type that's already been created for this?

I saw another thread that discussed creating a product category tree, but it didn't mention what data or content type the actual categories would be.

I'm using version 4.0.

Thanks,
Robb

Felix Laate

Wednesday 26 March 2008 6:47:23 am

Hi,

what kind of information do you need these categories to contain? Just a name?

As ezp doesn't yet support categories in a very clever way (like e.g. topic maps), the best approach (IMO) is to (if you have hierarchies with a constant structure) to make a hierarchy in the content tree, using any class that fits your needs. Then you make object relations between e.g. products an whatever categories you need.

Or, if you have the need for a more loose kind of a hierarchy, you could mimic a topic map by using object relations between a set og category-objects, which in turn are related to e.g. products.

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Greg McAvoy-Jensen

Thursday 27 March 2008 10:12:02 am

Robb,

I just wanted to make sure you found the key technology for hunting down objects of the same category: fetch (http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_fetch_functions).

Object relations is a good way to go. Another way of categorizing would be to to create a "selection" datatype; its documentation has an example of using it for a category: http://ez.no/doc/ez_publish/technical_manual/4_0/reference/datatypes/selection.

But for something hierarchical, the "multioption2" datatype may provide the functionality you need: http://ez.no/doc/ez_publish/technical_manual/4_0/reference/datatypes/multi_option2.

I hope this helps.

Granite Horizon, Certified Developer of eZ Publish Web Solutions
Provider of the SaaS Solution Granite Horizon In The Cloud | http://granitehorizon.com/cloud
http://granitehorizon.com | +1 916 647 6350 | California USA | @granitegreg
Blog: http://granitehorizon.com/blog

Chirag P

Thursday 27 March 2008 9:53:20 pm

Hey Greg,

You have given nice answer as it points me to the solution I was looking for.
Infact I'm working on something similar that Robb is working on.

I want to display a list of services(main servieces and then 1 level of subservices).
And list the businesses under each services(i.e. on click).

I am not getting a complete solution how to do this. So, far I understand that I will need to create (Business and Service classes(eventually objects too)), but I am not understanding how to go about creating templates?

How do I create templates so that I get paging based business list of a given service?

And How do I create various templates that I can display on various pages? e.g Most popular service or Newly Listed Businesses...?

I have searched internet for a complete walkthrough, but I didn't get any walkthrough of template creation or complete case where various templates are created. Everybody showed only template modification of single item.

I will appreciate help in that direction from every genius on this forum.

Thanks,
Chirag