以term分组显示节点

Using Drupal 6, I'm trying to create a page with views that shows something like the following:

-Taxonomy Term 1
-- Title and description of a node that contains this term
-- Title and description of a node that contains this term
-Taxonomy Term 2
-- Title and description of a node that contains this term
-- Title and description of a node that contains this term
-Taxonomy Term 3
-- Title and description of a node that contains this term
-- Title and description of a node that contains this term

 

Yes, this is definitely possible, and here's how.

  1. Create a new view and make "Node" the base table.
  2. Add a "Taxonomy: Vocabulary" filter for your taxonomy vocabulary, if you would only like to list the terms from a specific vocabulary.
  3. Add a "Taxonomy: Term" field, and have it excluded from display.
  4. Add a "Node: Title" field.
  5. Add a "Taxonomy: Term" sorting option. It's up to you whether you want it to sort ascending or descending.
  6. For the View's style, select "Unformatted", and in the options that come after that, select your "Taxonomy: Term" field as the grouping field.
  7. Make sure you have the "Limit Rows" set to unlimited.
  8. Make a page display, give it a URL.

That's it. The key point here is the "Grouping Field" part; that's what will group all of the nodes by the taxonomy terms assigned to them. Hope that helps!

 

你可能感兴趣的:(UP)