Creating A Page View From A Taxonomy

This video shows the user how to use the views module in Drupal 6 to create a page that list nodes with a certain taxonomy term. For the screencast I created a view that lists all of the nodes tagged with cck or views at http://www.learnbythedrop.com/cckandviews.

Bookmark and Share Bookmark or Share Post

Comments

Ian's picture

Premium versions

I am interested in obtaining the premium versions of your videos so I can download them to my local machine and watch them whenever I need info.

Are there any "Bundles" available rather than having to purchase each item individually?

learnbythedrop's picture

Premium Video Bundles

It's funny that you mention that. The short answer is no as of today. But I have been planning to do that and will start working on it this weekend. The bundled videos will be distributed at a discount over buying the same number individually. Stay tuned to this channel for more info in a little bit.

Anand's picture

Download from Youtube

You can download from Youtube right?

Ray's picture

Some of the terms and examples you use...

I like what you're doing here and you're getting a good inventory of content, but I'm a little 'meh' with the whole "drops" terminology, and I'd really rather see examples that don't use "CCK and Views" (for example) as your content. It might be easier to create the tutorial using examples from your own site, but it could get a little confusing. If the taxonomy terms were something totally different like "Kangaroos" and "Granite" it might be clearer to the viewer what was being done with what.

Manish Nagar's picture

This is not sufficient

Yeah !! this example is not sufficient to understand this topic, i think its not good.

learnbythedrop's picture

What is it that you thought

What is it that you thought you should have gotten out of this lesson that you didn't?

Josh's picture

Fantastic!

This tutorial is exactly what I was looking for! Thank you for taking the time to create such a fantastic resource :)

Zythyr's picture

Hey thanks a lot, great

Hey thanks a lot, great video. I have a few question with the applications of the Views module. I am trying to have Views create a page for me to list all the terms in a certain vocabulary. But I can't figure out how to do it.

I added a Vocabulary called "Classified", and underneath it, I added all the terms in a hierarchical fashion. For example: For Sale >> Electronics, Clothes, Books, etc. Jobs >> Accounting, Finance, etc. All I want to do is have all these terms listed on a page so users can see different categories, click on them, then see all the postings other users have made. I used the Views module to list all the terms but it won't work. I set it to create a page, and for the Fields, I put in Taxonomy All Terms...

learnbythedrop's picture

Views For Taxonomy Terms

When you created your view which "type" of view did you select? You need to select the "Term" type in order to create a view that just displays taxonomy terms.

Zythyr's picture

Below is the hierarchical of

Below is the hierarchical of all my terms under the vocabulary "Classified"

Classified
1. For Sale
a. Books
b. Clothes
c. Computers
d. Electronics
2. Housing
a. Apartments
b. Condos

3. Jobs
a. Accounting
b. Engineering
c. Finance

4. Wanted

Method 1: Using Node view.

Okay so here is the problem. Using Views, I created a Node view. Then I set the Row Style to "Field." I added "Taxonomy: All terms" field and set it to only show all the terms from the "Classified" vocabulary. I created the list of terms, but it had duplicate terms, and only showed terms that actually had a post using that term. Below is the output I got. So how do I get it to remove duplicate terms and also show terms that don't have a post using that term. Not only that, how do I get it to show all the list of terms in a hierarchical fashion?

All terms:
All terms:
* Jobs
All terms:
* Finance
All terms:
* Condos
All terms:
* Jobs
All terms:
* Finance
All terms:
* Housing
All terms:
* Condos
All terms:
* Jobs
All terms:
* Housing

Method 2: Using the Term view, as you told me to

For the Fields, I used Taxonomy: Term, and I used the Taxonomy: Vocabulary filter to filter out terms only from Classifieds vocab. Now the problem is, 1) Only terms that currently have post attached with that term, are listed, 2) The terms are not outputted in a hierarchical method. Below is my output.

Term: Accounting
Term: Apartments
Term: Books
Term: Clothes
Term: Computers
Term: Condos
Term: Electronics
Term: Engineering
Term: Finance
Term: For Sale

learnbythedrop's picture

Taxonomy Hierarchy

I assumed that you wanted to output a list of terms that had already been used. You want to create a list of the entire vocabulary whether the tag is in a post or not. Perhaps try the Taxonomy Menu (http://drupal.org/project/taxonomy_menu) module.

Zythyr's picture

Hey thanks for the reply, but

Hey thanks for the reply, but I noticed one problem. The Taxonomy Menu module creates "menus" from a given vocabulary. I don't want to create a menu. I want all my terms to be listed on a page. Is this possible?

learnbythedrop's picture

Taxonomy Page

I know that you can create a page view for taxonomy terms that will link to their category pages as I've done at http://learnbythedrop.com/categories. I don't know for sure about the hierarchy since I never seem to use hierarchies. In the configuration for the style of the field try selecting the "group by" option.

TB's picture

Re: Hey thanks for the reply, but

Zythyr - did you figure out how to create the view you are describing with taxonomy hierarchies?

labfm's picture

taxonomy page

Is it possible to create a cck page for a particular taxonomy term?

learnbythedrop's picture

Pages For Taxonomy Terms

Each taxonomy term has its own page already. If you click on the term you should be taken to the page where all posts for that term are listed. If you want to create a custom page for a term you can follow the steps in the video.

calefilm's picture

Taxonomy versus CCK Text Field

Hi Rob,

Thanks for all your insight and videos! Really helping me out. However, I'm stuck again:

I can't quite yet grasp the importance of categorizing lists using Taxonomy versus the CCK Text field.

For instance, and as you know, we're limited to how drupal core's taxonomy is able to present categories.. In order to present other options for term layouts, or check boxes for multiple selection (ie: radio buttons, etc), we need to download the content taxonomy. Instead, can I just use CCK Text Field and create my selection list under allowed values list in "GLOBAL SETTINS"?

I would like to use Views and Panels eventually and mess around with my Fields... and learn arguments, etc, etc,

My site pertains to a job listing board for my school. So some selection listings that I am categorizing are long but others are shorter.. It sounds like I will need Content Taxonomy for the major selection listings such as "class" and "teacher", but what about small things like (6, 7th 8th grade selection)? When I have a category that has only 3 terms, can I just as easily create a CCK field: text field and go under global settings and type in my 3 terms under allowed values list? So instead of using Taxonomy I'm using the CCK Text Field to categorize.. Should I use Taxonomy at all??? Can you explain when is a good time to use the CCK Text Field? I've fooled around a little bit with Views and realize I can place fields and categories (taxonomy) on Page Views but don't understand their differences.

Conclusion:
What are the advantages or disadvantages of using Content Taxonomy versus the plain CCK Fields to organize my categories?

learnbythedrop's picture

Taxonomy Via CCK

You make a pretty strong case for this particular approach. I haven't tried it so I really can't offer a strong opinion on whether the approach is better than taxonomy. I like to use taxonomy because it generates automatic RSS feeds, and it also works well with the Tagadelic module. There are also a number of other modules, like Glossary for instance, that rely on Taxonomy and improve the usability of the site. Taxonomy might not be the best thing for every site though. If I were you I'd perform some kind of a trial run using the CCK text field method to see how functional it is within the context of the site you're developing.

calefilm's picture

Content Taxonomy

Thanks. Yes, a trial run is a good idea.

As of now, I replaced using the core Taxonomy with the module Content Taxonomy and it's awesome! It's actually using the CCK method for inputting data into my site but still incorporating Taxonomy. What I mean is, you must create a taxonomy first, add vocabulary and terms, and then when you go to CCK, you reference the taxonomy and can use a new style and keep the CCK look--because Taxonomy core is limited in style/feel/functionality.

And to answer my question, I'll end up using the basic CCK Text Fields to input simple data into my nodes (data that I don't need to necessarily categorize or data that I don't feel my users will need to search for on my site).

I'm new at all this but this was a difficult obstacle for me to get thru. Thanks a lot for your site. It's saved me some hair!

Anonymous's picture

Creating a search form

Hi, Rob.

This screencast was very helpful in understanding how to output a page of content based on taxonomy. So, now I can do that.

However, what I really need to do is develop the search form that will get the site user to the pages I'm creating based on taxonomy. I have a suspicion this has to do with "exposing" the view filters, but I really don't see how that's done. In other words, how do I get my search criteria (taxonomy terms) to display (ideally, in a block)? When I try to set up a view with filters (Node:Published, Taxonomy:Term exposed, Taxonomy: Vocabulary exposed), I get a view with everything I've got on my site and no search fields, so that's obviously not working. Do I need to use CCK or some other module to set up a form? I'm pretty confused (as you can see).

Thanks.

P's picture

Thank you.

Thank you Rob for all the post. The tutorials are just one of a kind. Thanks for being so kind to all by posting.

Arthur's picture

Re: Creating A Page View From A Taxonomy

Something is missing : I do exactly all stages that are presented in the video, but the preview still says "Display uses field that are not present..".
So I tried to add a field in the field box, in the middle column of the view user interface and it solved this issue. But now the "field" box says : The style selected does not utilize fields...
I do not understand why, but it works...

lav83's picture

Re: Creating A Page View From A Taxonomy

Hi
Is there a way to create a link between taxonomy term and comment posted on blog, can you please explain it how to achieve it