Category Module: A Solution to Everything You Hate About Taxonomies and Books

06.29.2006

I’ve been watching the category module since January. Today, I’m ready to make a rather controversial assertion: this module has rendered both the taxonomy, and book modules obsolete.

It goes without saying that when making a serious decision, such as going to war, or declaring the taxonomy module obsolete, one better have a reason. Here are just a few of my reasons:

  1. It converts the book module’s flacid, pseudo menu into something useful: a real menu. In other words, it enables you to create a global navigation scheme (menu trees, and breadcrumbs) that will expand in response to whatever node your users are currently viewing. Before, books were invalid mini-sites that were seperated from the great context of the menu tree. They were a bad solution that one had to make, because there wasn't an alternative. Let us join hands, and celebrate the passing of that dark age.
  2. The category module not only gives you the option of automatically generating a menu item for every node that you file under a certain category… it gives you the option to create an pseudo menu item – so you avoid cluttering your menu, but have the benefits of context in terms of breadcrumbs and menu trees. Some "experts" say that its important for your navigation to a) show the user where they are, b) show them where they can go, c) show them where they've been. It was very sad that this simple goal was so hard to achieve in the past. Well, it is no longer, thanks to the category module.
  3. Every “category”, and every “container” are nodes. And wait, this should be explained:Foreach (TAXONOMY) { category = term, container = vocabulary }Foreach (BOOK) { category = child, container = parent} Every container, and category have an RSS feed. And since they are nodes, they can be themed like any other node. This = presentational freedom that both taxonomy and book sorely lacked.
  4. Pathauto now has native category module support. In otherwords, I dare you to see what happens if you set every node’s default path to [menupath]/[title], and every category and container to [menupath]. What you will find is SEO, and URL heaven – never again will you need to scheme of ways to make URLs, breadcrumbs, and menus all agree.
  5. We all know that the views module allows you to differentiate between taxonomy, and node types (just nod along like you knew that…). In contrast, the category module has full fledge views support. I’ll say it again: you can extend the category module’s organizational freedom, with the universe of presentational, and conditional options of the views module. That makes me a very happy person.
  6. In general, the new concepts put forward by the category module offer superior freedom in terms of the way content relates, is displayed, is navigated, and can be consumed. For the first time, you can build a comprehensive organized sitemap, using the sitemenu module. Oh – and did I mention, it has a bulk editor that makes complete reorganizations of a site’s structure take LITERALLY 1/40th of the time they would take with book, or taxonomy modules. F@ck yeah!
  7. I will never have to explain what a taxonomy is again. I will never have to show someone the difference between vocabularies and terms. Even better, never again will I have to hypnotize some poor bloke into believing that the seperation between taxonomy/menus/book hierarchies is a sensible thing. Though, its worth noting that I've become a good hypnotist.

So, to conclude and review, this module kicks ass.

Now for the fine print:

1. ON EXISTING SITES, DO NOT DO ANYTHING WITH THIS MODULE UNTIL YOU BACKUP YOUR DATABASE, AND CAN EASILY REVERT CHANGES. Technically this is always true with any module. Well, if you're trying to convert a years worth of taxonomy and books, I suggest you understand that you're going to screw it up the first time around.

2. (Update: this module does not break the book and taxonomy modules. Just remember: don't convert a vocabulary that another module depends on. [my mistake!])

Comments

buy wow gold cheap wow power

thank you ;) lida diyet

Thank You Koxp Koxp

Thank You

Koxp
Koxp

Thanks for this, it was

Thanks for this, it was really helpful! etek

Good durma about Koxp

Good durma about Koxp

Search issue

Overall I will agree that Category Module is pretty sweet. However, as you mentioned, there is a bug when it comes to searching. I realize your post is quite old, but I have recently worked on a site that used Category, and noticed that the search is broken. Basically, when a category comes up in the search, the results stop there i.e. the pager stops working. Now, the site I had to work on was made completely with Category, so it only ever showed one page of results. In fact, I noticed the same thing on the Category Module's homepage!

Is it just me, or have other people noticed the same thing?

PS. I have posted an issue, but no solutions yet :(

I'm stuck on categories.... LITERALLY!

First of all Nick... your a breath of fresh air. We need more intelectual yet sarcastic souls on this planet.

Now onto my problem...

I have been dorking around with categories now for about a week and I am literally about to throw my monitor out the window (no...its not a CRT...it's a fancy flat panel). My problem that I am having has to do with making containers the child of several category siblings in a different container. Ok let me explain.

What I would like is to create this menu structure.

Tutorials
- C++
-- Advanced
-- Intermediate
-- Beginning
- Java
-- Advanced
-- Intermediate
-- Beginning
... and on and on...

I have created two containers, one called Language (C++, Java, etc) and another called Level (Advanced, Intermediate, Beginning). I have then linked those containers to the Tutorial content type so that when I create a new Tutorial, I have two nice little drop down boxes waiting for me to specify the Language and Level (awesome!). What I cannot figure out is how in the world do I link the Level container to EACH category of the Language container. I would like to be able to simply add a new Language category (like FORTRAN...or something) and the Level container automatically attach itself to that category of the Language container. My ultimate goal is to have a breadcrumb that looks like this...

Home/C++/Advanced - Shows all advanced C++ tutorials
Home/C++ - Shows all C++ tutorials (all levels)
Home/Java/Beginning - Shows all beginning Java tutorials

Ok, you get the point. Can this be done? Anybody's help is greatly appreciated.

Thanks!

Travis.

Bulk edit nodes

I installed de category module and works great. Only thing it is missing is a bulk node editor for asigning them categorys. I have losts of un categorizaed content and it is a bit frustrating having to edit one by one. Does any one know a better way of doing this?

has potential but is not quite there yet

I'm very new to drupal, trying to set up a site and cam across "category" very quickly and used it immediately. Now I'm back to books and taxonomy :(

Although it looks promising, the category_menu seems to have serious issues and then there are the reported SQL errors about "duplicate keys inserted ...". Exp. after encountering lots of those errors I stopped using category for now :(

Also, I tried to do the "basic hierarchy" tutorial

But often I felt lost because 90% of the settings one has when creating a container/category are not mentioned and my end result looked quite different than the tutorial: links in the menu not appearing where they were supposed to appear but on the root level instead. That same result I got when I tried to set up my own site structure ... this menu thing never seemed to work as it should.

And perhaps most of all: what is the difference between container and category and when should I use which one?

thanks for listening ...

Works great

I have dewployed this on a drupal site I have and it is very good at doing ocntent organisation. One container is a book like structure for normal pages and the other is a Freetagging Container. Is is an amazingly powerful module once youve set it up correctly, the earlier versions tended to forget or reset settings. If category module did relation types and functionality like namespaces (well defined containers), it would be really cool.

Pants.

Am I the only one that doesn't really get this module? I'm in the process of moving my business site to Drupal and combining it with my tiny blog. I've just wasted a day trying to move it to Category. It's not a complicated site. One small vocabulary, less than 50 nodes, currently only using two content types. And yet so much broke. Oh well, back to the database backup! I can see that category may be very useful for certain large sites, particularly where you want to automate a lot of the menu and url alias production (for the less technical user). But for a small site where the admin understands Drupal and Taxonomy, there is little to gain from using category. It's all the more disappointing because the documentation is the best I've ever seen for a Drupal module.

Don't tell it, show it?

Nick, You are all expertise and enthusiasm. I suck at Drupal and just about any module you care to mention. But I am enthusiastic about it. Say, I sit here with a Drupal 4.7.2. The taxonomy says genre: news, picture, pressreleasesubject: apples, oranges, peachesyear: 2004, 2005, 2006 How will the Category module sweeten my site? What should I do to see the great effect is has? And how do I add images to this comment? Pasting didn't work.

TOC in categories

Thanks for nice PR :) I can't deal with TOC problem in Category module. I made a container, then inside it some categories, and inside categories several storis. And I can't see those stories in Table of Contents. With categories - everything OK. But on your site I see, that it is possible - http://www.nicklewis.org/node/841 Could you tell me how it was made? P.S. Sorry for my bad english, I'm living far away from english speaking countries.

*blushes*

Crikey - I'm so flattered, I don't know whether to laugh or to cry! I'm kind of doing both right now. Wow, Nick, all I can say is: for ($i = 0; $i < 1000000; $i++) { print "THANKYOU!;" }. :-P Through your high quality and frequent blogging, you have become a powerful voice to the Drupal community. I consider it the highest honour that the category module has earned getting its praises sung on this site. It is indeed a controversial position to take, that category has rendered book and taxonomy obselete. The idea was controversial when I first proposed it over a year ago, and to be honest, the development and the release of the category module has been met largely with scepticism and criticism. But in that time, more and more Drupal developers have joined the "everything should be a node" camp; and even of those who don't really believe that "everything" should be a node (I myself have doubts about some things, such as users), most would agree that terms and vocabularies are two of the entities in Drupal that could most benefit from becoming nodes. Your fine print is unfortunately only the tip of the iceberg. The category module issue queue is currently overflowing with bug reports, the majority of them related to category_menu. I am trying to keep on top of the bug queue, but more developer help (for writing patches) is always welcome! In retrospect, I believe that announcing the end of the module's beta status was very premature. Considering the current problems that users are having, the module should still be considered beta. One problem that I've found, in explaining the category module to newcomers, is that it seems to have a large amount of pre-requisite knowledge. To understand the cateogry module properly, you need to first understand taxonomy (which most Drupal newbies really struggle with), then you need to understand book as well, and then you need to understand how category is different to its predecessors, and what additional stuff it adds on top of its predecessors. So really, the learning curve for mastering the category module is quite steep, and I would be interested in any suggestions that people may have for making it more accessible to first-timers. Also, Nick, I will be delighted if/when your own site is converted to category. You taxonomy_menu blocks serve their purpose well, but category-generated menu blocks would be so much nicer. Please follow your own advice, and try everything first on a test site, and do a complete backup before attempting anything live. -- Jaza

100% agreement

The SEO bliss goes even further in that modules like nodewords and page_title work for category and container nodes whereas you have very little control over the META tags and TITLE tag on taxonomy generated pages. Other advantages of having categories and containers as nodes:
  • you could publish/subscribe to them using the pub/sub modules and keep two site's structures in sync
  • hook_taxonomy is obsolete because you can now use nodeapi
  • node access permissions can be applied easily to containers or categories
  • you could sell containers or categories as products with ecommerce
  • you can change *any* node into a container or category. An example of this would be using image or audio nodes as your categories where the picture or sound excerpt in some way enhances the meaning or presentation of the category.
  • not only does tagging and autocompletion still work, there is also the activeselect module which gives you interrelated select fields that are AJAX bound to each other
  • you could make true folksonomies with just a little extra work by creating a new container node for each user and making them all children of a common container. The top container would have access to the entire set of categories underneath it while each user would have their own little tag world.
  • you can expose creating categories to your site users in a reasonable way, without granting them "administer taxonomy" permissions
One bug that still remains is that categories mis-represent themselves in the search index. They show themselves to the search module as the aggregate of all their categorized nodes, thus showing up in search results on their nodes' behalf. I've been using Category for some months and I now regularly ditch book and taxonomy as part of my initial setup for any site I'm building. For me, this module, Views and CCK *are* core.

new features for page_title

Just wanted to mention that I patched the page_title module fairly significantly to give more control over the title tag -- for those interested in SEO. Works great with the category module. http://drupal.org/node/72973

wow i'm sold

nick & robert have spoken. ok i'll go category module instead of taxonomy. taxonomy is pretty weak i must say. with new forms api + views + cck, and now this, you definitely get the impression that in the world of Drupal, the ground beneath your feet is constantly shifting.

Excellent!

Great overview of the benefits of category to add to Nick's post.
node access permissions can be applied easily to containers or categories
Is there a particular module you would do this with? Does this make using a TAC-integrated-with-category redundant?

I’d use path_access… but

I'd use path_access... but only because I've had bad experiences with all the TAC modules. Their cheif problem is that they've had a tendecy to default to "restrict all access" when I have typically only wanted to hide 1 or 2 vocabularies.

Thanks!

I will try path_access.

Yay! Glory to category

Nick, thank you for this detailed post that will open people's eyes to the power of category module. It always has a powerful impact when an experienced drupal consultant of your stature recommends a particular module. I am particularly glad you like category's bulk edit and pathauto functions. [Caution: a bit of self-promotion here;-)]I sponsored the category_pathauto module and co-sponsored category_bulk edit with drupal.org user kiteatlas. I am also hoping to sponsor/co-sponsor TAC's full integration with category module which Jaza will probably look at after Google SoC.
. This module breaks both book, and taxonomy modules...(hint: forums, simplenews, and image galleries may get screwed up (and any other module that depends on taxonomy)… …for now… …I'm guessing it can be avoided, but I simply haven't had time to work it out.)
Actually, category doesn't break any of these modules when you use the taxonomy wrapper modules. This lets you use any taxonomy based module successfully with category. I have successfully upgraded to 4.7 and then converted a fairly large site with simplenews and image galleries and they worked fine. On new sites, they have worked like a charm, although there are a few things to keep in mind. I think there may still be some issues with converting taxonomy based forums over to the category module. Currently, the biggest issues with category module are in the menu area. To anyone looking to convert their taxonomy based site to module, I would repeat your words of advice to proceed cautiously and ideally on a test site. And, please remember to increase your php_timeout settings in php.ini or only half your categories will make it over and you will be frustrated.

here here

Who could not love categories???? none of my clients ever created a single taxonomy before this... ..one question.. will freetagging be suppported? cool! ryan.

Free-tagging support in category module

Yes, free tagging is supported, but as per Jaza, it is only either freetagging or regular categories for a container (vocabulary). You can't have both.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.