Hi all. Using 5.2.

What is the best way to list the subcategories of a category on a node?

For instance, I have a category called About, which has a node. Within that I have several subcategories: Logo, History etc, each with a node. I would like for my About page to have the About text, then links below that text to the Logo and History nodes.

Thanks

Shrill

Comments

crookednumber’s picture

Are you using menus for these, yes? Or are you using categories/taxonomy?

Also, before everyone else and their dog tells you, UPGRADE immediately. The secure version of 5 is now 5.9.

shrill’s picture

I started out by creating menus and the decided that I need more levels than I want to show in the menu. So I've now created categories and assigned all the nodes to them.

Thanks for the tip on upgrading: I don't know how I missed that! This is not a live site, so no worries...

crookednumber’s picture

Well, there's more than one way to do it. Here my personal take. Whenever possible, use categories as a way to tag the content (Georgia, Olympics 2008, Obama)

For a more permanent structure of the site, e.g.:

News
--Politics
--International
--Sports

use menus.

And in the example you gave me, it certainly sounds like you're creating site architecture.

It might get kind of confusing if you're coming from something like Joomla (where they use 'category' to mean 'sub-section of the site' instead of 'tag').

So, to answer your question, once you create a menu, a block which holds that menu is also created. And you can place that block (almost) anywhere on a page (limited by the theme you're using).

Either way, you should probably start with learning how to use Menus (you undoubtedly need them at some point):

http://drupal.org/handbook/modules/menu

Also, read up on the Path module (part of core) and, once you feel comfortable, the Pathauto module (part of the contributed repository).

shrill’s picture

I should probably give another example of what I need to do. I did come from working with Joomla, good catch! :)

I have an About menu (as above). I have a publications folder that needs the following architecture:

About
->Publications

---->Subsection

-------->Article1

-------->Article 2

---->Subsection

-------->Article 3

I want my menu (in my left hand column) to have only:
About
->Publications

And then the publications page would have the same content that it has now, but list the Subsections below (within the actual content pane). Then each Subsection would have the list of articles in that subsection within the content. Basically, users would follow the menu to the Publications page, then drill down like a directory, but within the actual content and only showing the relevant subcategories of the page they are on.

Ideally, I would like to accomplish this automatically without having to go into each individual page and adding in the links and with the structure remaining the same: just the display would be different.

crookednumber’s picture

You probably want to use two indispensable contrib modules here:

PathAuto -- so that any new publications has an auto generated URL like:
example.com/About/Publications/Full_title_of_the_Pub

http://drupal.org/project/pathauto

Views -- so that you can create dynamic lists of almost any content. So you could say generate a list of all pubs (that is automatically updated) and place that list almost anywhere.

http://drupal.org/project/views

Also, you'll probably want to look in to CCK, assuming you want your Publications to have more than a Title and Body field:

http://drupal.org/project/cck