Using CCK nodes to build a category hierarchy
The categoryi module has always supported transforming nodes of any type into categories or containeris. However, up until very recently, this was something that could only be done for individual nodes (it was originally core functionality, and it has now been moved into the category_transform module). But, with recent developments, it is now possible to make an entire node type behave as a category or a container node type! This brings the full power of the category module to non-category node types, such as image nodes, event nodes, and - best of all - nodes that are user-defined through the CCK.
This tutorial will step you through the creation of a simple CCK node type, and will then show you how to create category-CCK-nodes, that become part of your category hierarchyi, and that can be used to tag your dynamic content.
Assumptions
For this tutorial, it is assumed that you have category, category_display, and category_menu installed on your site; and that you have installed both the taxonomy wrapperi and the book wrapper. You will need to have at least these modules in the CCK package installed (you can install more if you want): content, date, and text. Installing the activeselect module is recommended but not required.
It is also assumed that you already have a basic understanding of the category module; if you feel that you don't, then you should read through the creating a basic hybrid structure tutorial first. You should have some familiarity with the CCK module, although what we'll be doing with it is pretty basic; and seriously, it's really easy to use anyway.
What are we trying to do?
This tutorial is focused on using other node types with the category module, not on creating complex multi-level hierarchies. For that reason, we'll simply be creating a series of traditional, taxonomy-style structures of containers and child categories. No distant parentiis involved, I promise. No twice-removed cousins, great-aunts, nieces of nephews, or third husbands either. Mother-in-laws are right out.
We'll be creating two containers whose categories may be of the built-in 'category' node type, and a third container whose categories may be of a CCK node type that we shall call 'person'. The structure will look something like this:
Topics (*)
-- [topic categories - nodes of type 'category']
Moods (*)
-- [mood categories - nodes of type 'category']
People (*)
-- [person categories - nodes of type 'person']Legal note: the above diagram is a crude and possibly inaccurate representation of what is to follow. The author of this tutorial may not be held responsible in any way for misconceptions or misunderstandings caused by the lack of clarity or substance in said diagram. Any resemblance between the aforementioned diagram and anything that is remotely possible with the category module is purely coincidental. The category module may give you lung cancer, and may harm your unborn baby. You have been warned.