Taxonomy view with nodes

佐手、 提交于 2019-12-07 16:10:18

问题


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

So basically when I go to this page, I see taxonomy terms of a particular vocabulary listed out as titles, and underneath I see the title and description of all nodes that have this taxonomy term.

Is this possible to do with views? Or if not, Is there another module that can help me? Or should I be rolling my own for this situation?


回答1:


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!



来源:https://stackoverflow.com/questions/3512582/taxonomy-view-with-nodes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!