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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:34:49
Script start
Timing: Jan 18 2025 19:34:49
Module start 'layout'
Timing: Jan 18 2025 19:34:49
Module start 'content'
Timing: Jan 18 2025 19:34:50
Module end 'content'
Timing: Jan 18 2025 19:34:50
Script end

Main resources:

Total runtime1.4176 sec
Peak memory usage4,096.0000 KB
Database Queries64

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.2734152.6563
Module start 'layout' 0.00560.0026 741.929739.5078
Module start 'content' 0.00821.4076 781.4375630.1094
Module end 'content' 1.41580.0017 1,411.546912.0938
Script end 1.4175  1,423.6406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2459160.0002
Check MTime0.00140.0965160.0001
Mysql Total
Database connection0.00070.049510.0007
Mysqli_queries1.354895.5701640.0212
Looping result0.00070.0489620.0000
Template Total1.385897.820.6929
Template load0.00220.152320.0011
Template processing1.383797.608420.6918
Template load and register function0.00020.014810.0002
states
state_id_array0.00080.054410.0008
state_identifier_array0.00350.245220.0017
Override
Cache load0.00180.1304360.0001
Sytem overhead
Fetch class attribute can translate value0.00070.046040.0002
Fetch class attribute name0.00140.101160.0002
XML
Image XML parsing0.00150.107240.0004
class_abstraction
Instantiating content class attribute0.00000.000860.0000
General
dbfile0.00120.0858240.0001
String conversion0.00000.000540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs