Question Regarding Categories & Taxonomy

Events happening in the community are now at Drupal community events on www.drupal.org.
spkelley's picture

I am building a site and I want to manage certain posts and I thought I'd tap the local community for some advice on how to set it up properly.

The site would allow users to submit news articles. Free tagging will be implemented. I have 'news' set up as a term in taxonomy with the list of associated terms. My question is how do people view all 'news'?

I'll help flesh it out.

Person logs in->Create News->Fills in title, source (cck link), tags, and then selects news type from drop down which is pulled from terms (see above). So say the taxonomy term is Sports News. Terms might be Hockey, Basketball, Football, etc. I imagine i click on Football and all Football stories comes up, etc. But what if I have users that just want to see all Sports News to include Hockey, Basketball, Football, etc?

Am I missing something?

I am not using categories or books. Categories sounds like it hinders load times, and I certainly don't want that and I'm not sure if actually need it.

Thanks in advance.

Comments

Views

xjm's picture

The short answer is, use views. You can configure it to show pretty much any combination of stuff you want. Are you using D6?

I am using Drupal 6 and do

spkelley's picture

I am using Drupal 6 and do have views. Guess I never thought of that. Thanks!

Like it was said above, Views

posco's picture

Like it was said above, Views is the best way, since it gives you so much control. You can filter nodes based on the taxonomy terms assigned to them, much like you can with values of CCK fields. Just add a new filter, select Taxonomy from the "Group" drop down, and select "Taxonomy: Term" as your filter.

The other way is to use Taxonomy's built in paths. They aren't as nice. Say I wanted to display all the content tagged with a term that had term ID 5, I could do this by going to:

http://my-site-url.com/taxonomy/term/5

I believe you can also make those look prettier with some like Pathauto or with just plain path aliases.

The other benefit with Views is that you have more flexibility with your theme, and you can make blocks that display content filtered by taxonomy term.

Oh, and...

posco's picture

For the more complicated "Sports News" idea. If you know the ID of the Sports News term, then using any other methods outlined above will display all the nodes with "Sports News", regardless of they also have Hockey, etc. So just make sure that all the "sub categories" share the same "parent category" and you will be set.

There may be a more elegant way of doing this using Taxonomy hierarchies. I've never really had to do this, so I'm not so clear how it works, but in the Taxonomy admin area, you can specify terms that will be children of other terms. It would look something like this:

- Sports News (Term ID: 1)
  - Hockey (Term ID: 2)
  - Football (Term ID: 3)

If a node now has "Hockey" and not "Sports News", they may still show up by going to:

http://my-site-url.com/taxonomy/term/1

If someone knows if this is or isn't the case, please correct me. If it doesn't work this way, you can probably write up a module that can easily do this using the Taxonomy module's API function. You can view them here: http://api.drupal.org/api/drupal/modules--taxonomy--taxonomy.module/6

Geez, I didn't look close

spkelley's picture

Geez, I didn't look close enough to Taxonomy to realize the parent option. The only drawback, at first glance, is that the user could choose 'All News' rather than one of the child terms when posting a news article and selecting a 'category' which would be a taxonomy term, ie 'hockey'.

I have some good ideas. I did set it up in views and then added a menu option, then set up the child options as a submenu. I think I'm on the right track. It sounds like I have a few different options that will work out either way.

Thx!

Wisconsin

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: