Multiple Level Categories
Permalink 1 user found helpful
I would like to see a package that offers similar functionality to the Drupal Taxonomy module. Taxonomy is a fancy term for categories, and what it does is enable tiered categorization. You can have as many levels of categories as you like, creating a category tree such as what you see below:
Category Tree for Car Makers and Models:
GM
- Cadillac
-- CTS
Ford
- Focus
Toyota
Now in Drupal Taxonomy first you setup your category tree, and then this category tree can be used as a field and attached to content. In C5, the equivalent might be to create an new Attribute Type named "Category" based on the Select Attribute Type. The major difference is that Select Attribute Type stores 1-level. What we need for categorization, is unlimited levels, and ability to load terms in the tree, and to load parents/children.
Once we have the Category Attribute Type built, C5 users can categorize pages, members and files using multiple level categories. The next step is to create Blocks that work with categorized content, here are a few suggestions:
- Category Menu Block, displays list of categories with link to a page that shows all content contained in that category.
- Category Latest Block, lists snippets of latest content added to a given category or set of categories.
In Drupal Taxonomy another feature that is highly prized is the automatic page creation for new terms added to a taxonomy. Suppose your running an auto listing website. So you add a new model to your category tree such as "Prius". Instantly a page is created such as yoursite.com/terms/prius and it lists all content categorized with the term Prius. So if you add listings for a Prius for sale, or a blog post about Prius, it gets added to this category term page. That is great automated SEO, and those term pages can be modified and used in many different ways.
In summary, a package named "Category" or "Classify" would include:
- New Attribute Type based on Select that allows multiple levels of terms to be created as a tree
- Blocks for displaying and linking to categorized content.
- Automatic page creation when a new category term is created, with aggregation of categorized content.
Category Tree for Car Makers and Models:
GM
- Cadillac
-- CTS
Ford
- Focus
Toyota
Now in Drupal Taxonomy first you setup your category tree, and then this category tree can be used as a field and attached to content. In C5, the equivalent might be to create an new Attribute Type named "Category" based on the Select Attribute Type. The major difference is that Select Attribute Type stores 1-level. What we need for categorization, is unlimited levels, and ability to load terms in the tree, and to load parents/children.
Once we have the Category Attribute Type built, C5 users can categorize pages, members and files using multiple level categories. The next step is to create Blocks that work with categorized content, here are a few suggestions:
- Category Menu Block, displays list of categories with link to a page that shows all content contained in that category.
- Category Latest Block, lists snippets of latest content added to a given category or set of categories.
In Drupal Taxonomy another feature that is highly prized is the automatic page creation for new terms added to a taxonomy. Suppose your running an auto listing website. So you add a new model to your category tree such as "Prius". Instantly a page is created such as yoursite.com/terms/prius and it lists all content categorized with the term Prius. So if you add listings for a Prius for sale, or a blog post about Prius, it gets added to this category term page. That is great automated SEO, and those term pages can be modified and used in many different ways.
In summary, a package named "Category" or "Classify" would include:
- New Attribute Type based on Select that allows multiple levels of terms to be created as a tree
- Blocks for displaying and linking to categorized content.
- Automatic page creation when a new category term is created, with aggregation of categorized content.
I too, would like to see something like this! I am working on a new theme/ add-on that will require this sort of thing.
Is it so that one page can only have one of those categories? And e.g. I could categorize my car to either GM or CTS. Meaning that it could be categorized into any level on the category tree?
And would you want to be able to categorize one page under multiple "top tiers" (I believe these are called vocabularies in drupal, I mean the ones under which you e.g. create the car categories)?
Overall, seems quite interesting but also challenging job... Like a job for us. :)
And would you want to be able to categorize one page under multiple "top tiers" (I believe these are called vocabularies in drupal, I mean the ones under which you e.g. create the car categories)?
Overall, seems quite interesting but also challenging job... Like a job for us. :)
I have been contemplating this a lot as well. This is where the page paradigm breaks down, and everything is forced to be customized. I've done a wide variety of sites using my own lightweight cms to do this, but it doesn't translate well here. Basically, you have to make a new "page" for every new car, and have Make be a custom attribute that you filter by in a customized page list.
Perhaps tags could kind of be used to do this, my not to the level you are likely asking for.
When I was doing data centric sites, I would code the url as /$CAT/$ID-$PrettyName.htm, which htaccess would rewrite to use the category page of that type, using the DB id of the url. That won't work here without a massive rewrite, and full world view change. I know you can link to external DBS, and perhaps use that to your advantage, but I don't see a good way to do category->product, especially to many nested layers, with C5. If anyone could tell me how, it would make all the difference in the world.
Perhaps tags could kind of be used to do this, my not to the level you are likely asking for.
When I was doing data centric sites, I would code the url as /$CAT/$ID-$PrettyName.htm, which htaccess would rewrite to use the category page of that type, using the DB id of the url. That won't work here without a massive rewrite, and full world view change. I know you can link to external DBS, and perhaps use that to your advantage, but I don't see a good way to do category->product, especially to many nested layers, with C5. If anyone could tell me how, it would make all the difference in the world.
Thanks for your reply. I'm glad to see I'm not alone in thinking categorization is important in many situations, and C5 currently does not have a solution in this area.
In response to what you said about how each car in our example car dealership site would be a C5 page... therefore we need attributes attached to the Page Type. I think your right about that. And so tags, or a select box is currently the closest solution. But we need to have support added for multiple levels, trees of categories.
I think building a custom attribute type is the answer. Now from I've seen of the attribute type code, its a medium-difficult level challenge to do that. The select attribute type for instance, runs around 900 lines of code. But this would be like a select, only more complex. It would need methods for iteration through the tree, and ability to load parents/children from the tree.
I'd actually like to see someone from the core team weigh in on this. Because they must have thought of something like this before?
In response to what you said about how each car in our example car dealership site would be a C5 page... therefore we need attributes attached to the Page Type. I think your right about that. And so tags, or a select box is currently the closest solution. But we need to have support added for multiple levels, trees of categories.
I think building a custom attribute type is the answer. Now from I've seen of the attribute type code, its a medium-difficult level challenge to do that. The select attribute type for instance, runs around 900 lines of code. But this would be like a select, only more complex. It would need methods for iteration through the tree, and ability to load parents/children from the tree.
I'd actually like to see someone from the core team weigh in on this. Because they must have thought of something like this before?
I recently started a new topic with a simular issue:http://www.concrete5.org/community/forums/customizing_c5/two-dimens...
Unfortunately no concrete solutions yet in my case either. I totally agree about the urge of an attribute type with multiple select levels. Should be a core thing really. Now the C5 team already has made our lives so much easier by applying us with their great CMS, totally free, so I'm not in the position to make demands here. But wouldn't it be nice if they would look at this, hm...?
Curious however if you somehow found a workaround for this issue. Please let me know!
Unfortunately no concrete solutions yet in my case either. I totally agree about the urge of an attribute type with multiple select levels. Should be a core thing really. Now the C5 team already has made our lives so much easier by applying us with their great CMS, totally free, so I'm not in the position to make demands here. But wouldn't it be nice if they would look at this, hm...?
Curious however if you somehow found a workaround for this issue. Please let me know!
There are a few workarounds that I have thought through, but have not had time to test or implement.
A few notes:
1. You can access an outside db with built in functionality if you need to.
2. Packages can have their own schema.
Since you probably want the site to be crawlable, ajax is not the best option. Instead, we can leverage single pages.
Create a package, and create a schema for that package (db.xml). Then you will need to create single page editing functionality for each layer of the categories (this is normal of course).
Then, you will use the action system of controllers. For example, you can make a category name an action, which makes for really nice urls (/cars/volvo). Cars will be the action, volvo the parameter you send to the action. The action will then parse the model, and load the appropriate page into the view for car types.
This is all theoretical, as I haven't had the time to code it, but I am planning to for a site that I will be doing in about a month. If anyone else has a better idea, I'd love to hear it.
A few notes:
1. You can access an outside db with built in functionality if you need to.
2. Packages can have their own schema.
Since you probably want the site to be crawlable, ajax is not the best option. Instead, we can leverage single pages.
Create a package, and create a schema for that package (db.xml). Then you will need to create single page editing functionality for each layer of the categories (this is normal of course).
Then, you will use the action system of controllers. For example, you can make a category name an action, which makes for really nice urls (/cars/volvo). Cars will be the action, volvo the parameter you send to the action. The action will then parse the model, and load the appropriate page into the view for car types.
This is all theoretical, as I haven't had the time to code it, but I am planning to for a site that I will be doing in about a month. If anyone else has a better idea, I'd love to hear it.
Hi cryo
did you ever manage to achieve this with the site you were building?
did you ever manage to achieve this with the site you were building?