以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!

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值