Categories and several hierarchies concurrently

Author Message

Christian Johansen

Monday 07 November 2005 7:22:42 am

Hi, I might be asking a dumb question, but I couldn't figure it out myself :( I did a fresh eZ install with a blog site to play around with. Unfortunately what I was looking for wasn't there - categories. I was wondering how content can exist within one hierarchy and still belong to one or more other categories as well? Since the blog didn't ship with such functionality I have nothing to play around with, so I was hpoing one of you could point me to some tutorial/articles about it. Anyone done anything like this?

Gurudutt Verma

Wednesday 09 November 2005 1:51:14 am

Hi

It is bit difficult to make such feature that weblog belong one hierarchy and still belong to one or more other categories.

One solution for this could be:
create one new datatype let's say category.
This category will fetch all rows for selection from seperate table and try to maintain relation between weblog and category in seperate table also design seperate module to maintain all category, It will be bit complex datatype but it is possible.
All the best

Alexandre Abric

Wednesday 09 November 2005 2:19:01 am

Hi,

It is not that difficult if you use related objects (native datatype or one of the contributed datatypes - see the Contributions page) to achieve this functionnality.

The target item should have one or serval "related object" fields in its class. On your web site, you would have an invisible "System" folder to store your categories objects and then add a relation to one of these objects on your target item (when creating it).

Christian Johansen

Wednesday 09 November 2005 7:31:13 am

Thanks for your input. I also had the idea of creating two folder hierarchies like so:

Stuff (Folder)
- Bits (SubFolder)
- Pieces (SubFolder)
- - Small pieces (SubSubFolder)
- - Medium pieces (SubSubFolder)

And then

Categories (Folder)
- Wildlife (SubFolder)
- Citylife (SubFolder)
- - Cafes (SubSubFolder)
- - Shops (SubSubFolder)
- Economy (SubFolder)
- - Personal economy (SubSubFolder)

and then place each article in one folder from each tree, having one of them set as primary placement.

I'd place an article like this:

"Small pieces on display in local shop"
Primary:
Stuff - Pieces - Small Pieces - "Small ..."
Other placements:
Categories - Citylife - Shops - "Small ..."
Categories - Economy - Personal economy - "Small ..."

This way an article will be a "small pieces" article, but also implicitly be in the categories shops and personal economy (as well as citylife and economy)

Do you consider that a bad idea?

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