Category vs taxonomy and book

The categoryi module is very similar to the modules upon which it's based, namely book and taxonomy. This leads to a great deal of confusion over just what the difference is between category, and taxonomy and book. This page aims to explain what the differences are between these modules, and why the category module is better suited to a number of common tasks.

Firstly, let's go over what the taxonomy and book modules do. The taxonomy module allows you to define a number of vocabularies, each of which holds a set of terms (which can be arranged in a tree-likei hierarchyi). Nodes on your site can then be tagged with these terms (making them assigned nodeis). Vocabularies and terms are not themselves nodes. The book module lets you structure a group of nodes on your site into a strict tree hierarchy. It provides a contents block and other navigational elements, to help your users browse the tree of nodes.

The category module, at the most basic level, does both of these things at once. You can create a hierarchy of nodes (as a strict tree or in a tree-like fashion), and you can use those same nodes to tag other nodes on your site. It sounds simple when you say it like that. And that's because it is simple. However, while this merging of features may seem trivial, the results are not. It gives vastly improved power and flexibility for Drupal site architects.

Dynamic, categorized content is now able to have its position within the site hierarchy controlled and made predictable. Categories, categorized content, and static information pages are all able to be structured together into a single hierarchy, and this can all be done through a single uniform interface. Additional tools allow pages controlled by other modules to also be slotted into this hierarchy, without disrupting the structural rules put in place by these external modules.

The category module also has a number of features that its predecessors do not. With category_menu, a menu hierarchy is maintained that corresponds to your site's category hierarchy. Because category_menu saves all menu items to the database, you can manually change the parenti of any node, using the menu module. You can also use the menu module to bring in other pages, such as those generated by external modules, and include them in your category hierarchy. With category_display, you can control all of the navigational features that are simply forced to display with the book and taxonomy modules. You can have a table of contents show for some categories on your site, but not for others.

If you are happy with your dynamic content being tagged but not actually structured, then the category module is probably not for you. The same can be said if you're happy with the amount of control you have over a hierarchy of static pages using the book module. But if you need the features of both taxonomy and book working together, and you need more control over the whole process - and you also need full compatibility with the old modules - then the category module is your new best friend.

Restricting access

I ran a small website with Drupal's (4.6.6) forum. These are some of my forum containeris:
- Announcement
- Sports
-- F1
-- Football
- Food

Accept Announcement, my users can post in whatever forum that they wished. I made use of the taxonomy_access module to impose such restriction.

Question: I am setting up a new website with Drupal 4.7 and would love to implement your categoryi module. Can I achieve what I have on my previous website forum with your category module? Do I still require taxonomy_access or do you have other recommendations?

Thanking you for your every assistance.

Taxonomy_access

I recommend that you continue to use taxonomy access. As you can see, it does work with categoryi (at least, it does for the purpose that you have in mind). Category does not have its own access control solution built in, except for the cac_lite module, which is significantly less powerful than other solutions (it's designed for quite specific needs). Alternatively, you can try using other node access modules, such as organic groups or node privacy byrole.

book.module wrapper on 4.73 doesn't have a create book option

Greetings,
I have installed the book.module wrapperi on a drupal install of 4.73. It is enabled and installed but when I go to submit content, the option to create a book isn't there. It's strange because I've set up three different drupal sites and for some reason, in two of them I can't access create book. I've also tried going to domain.com/node/add/book but get a blank page. I've seen this come up in the drupal forums but haven't found an explicit answer on what to do to get it to show up.
Thanks.
Lsabug

Wrappers and Printing

I'm using the categoryi module, and have activated the taxonomy and book wrapperis. I've been having trouble controlling the printer-friendly function, and have been told that the module I installed doesn't work with the book module. So, three questions:

1) I can't seem to find anywhere to modify the printer-friendly format that is already there in the category module. I'm not sure if that is part of the book module, or part of category--but I don't know how to access (control the formatting) in any case.

2) I'm not sure if I really need the book wrapper or taxonomy wrapper. I'm creating a new site, so I don't have any old nodes to bring in or anything. Was I just being over-zealous when I enabled the book and taxonomy modules and wrappers, or is there some useful functionality there?

3) On a separate issue, is there anyway to access the hierarchical structure within the node.tpl? Specifically, I'm trying to preface each blog node title on the front page with its parenti category. Something like-- "Maintenance: Taking care of your carburator" where the title of the entry is "taking care of your carburator" and the parent category is "maintenance". I've searched high and low, and can't seem to find any way to automatically access the name of the parent category for a given node.

Thanks,

Ken

Found a solution to #3

I seem to have solved the problem in #3 by adding the following lines to the end of the categoryi.inc file:

function parenti_title($node) {
if ( ! $node || ! $node->parent ) {
return '';
}

$node = node_load(array('nid' => $node->parent));

return $node->title;
}

I'm completely new to php and drupal, so if I've made some ghastly security error or something in the above, I'd really like to know--both for me, and to change this in case anyone else uses it. I put in in the category.inc file because I got a white screen when I tried it in the node.tpl.php file.

I then put the following code into the node.tpl.php file just before the print $title command:

if ($is_front) {
$parenttitle = parent_title($node);
print $parenttitle;
print t(": ");
}

It works like a charm.

Hope this is useful.

Ken

Partial answers to 1 and 2

I've finally discovered that the print friendly link is part of the categoryi module.

I made the mistake of thinking "category-export" meant exporting the category structure or something like that, so didn't look there (and for some reason my searches for printer, and printer friendly, etc. on this site never turned that page up. (maybe I misspelled something)

Anyway, I've also discovered the style sheet for printing in the misc folder. What I can't seem to find is a .tpl.php file, if there is one involved, that would allow me to do things like add footer information, or a simple logo, etc.

Does anyone know if that exists?

Thanks,

Ken

Categories and Containers

I am reading the documentation with excitement. It makes perfectly sense to me to have taxonomy as nodes for all obvious reasons (on top of workflow etc. i am thinking of translations here).

however, i wonder why you ve chosen to distinguish between categories and containeris in your model. i have used taxonomy and books in several projects. i found the distinction between vocabularies and terms that taxonomy has, always a disadvantage and unnecessary, whereas i liked the way how the books module does it. a book page can be part of a book as well as the book itself (if being the root book page). this gives me a lot of flexibility - always being able to extend a book on each end and to break it as i whish.

what was the reason for you to distinguish between categories and containers and what s the advantage of it as opposed to just use cascadable categories as drupal books uses cascadable book pages?

i agree

I asked this same thing a few months back - the idea of "categorizing" nodes seems to make perfect Object Oriented sense; but in a very non-OO sense; i dont get why you need containeris.

- cats can hold cats (so why do you need a container to do this)
- you could specify overall global properties of a cat (such as no "next, back" links) just like you can with a container

I wouldn't say i am a CATs expert yet.. but from a programming view point; really doesnt make sence to have containers

can i fix my books?

It was taking me a while to figure out why my "page" nodes didnt all look the same. Some had "Next, Back" links and some didnt. Realized that it was because some are book pages and other are cats (which are controlled by containeri display options to NOT have next, back links). Wasn't sure why i did this; i guess i had book.mod enabled initially; which gives "add new page" as an option under a page - and before i knew what i was doing (yea, like i do now???) i added some pages.

After reading this post i now get there is no need for books with cats. So i think i just should not have had that module enabled in the first place...

... BUT.. now that i did - is there any way to fix this???

I disabled the book module and my book pages are now type-less. Plus i have the cat_transfomer module enabled. So shouldnt i be able to make my old book pages (now type-less) into cats?

My first guess would be to go to database and simply set the node type to that for cat - but this is usually not a great idea :)

Peter,
www.LiquidCMS.ca

result of db hack

well i tried my db hack - i went into db and changed type from book (which is now meaningless since i turned off book module??) to categoryi-cat and sure enough when i see node listed in content listing it now shows as a category..

BUT... when i view the node i now longer have links to add children

BUT... when i go to edit the node, and simply hit save (with no edits) it now seems to be fine.

I am guessing there is a cleaner way to do this; anyone know???

Peter,
www.LiquidCMS.ca