简体   繁体   English

Drupal 7视图-按内容类型和分类术语分组

[英]Drupal 7 Views - Group By Content Type and Taxonomy Term

I'm hoping there is a solution for this within Drupal that's not too difficult. 我希望在Drupal中有一个不太困难的解决方案。

I have 2 content types, 1 is Brochures and the other is Product Cards, I've created a view that has grouped these 2 together, however i need to also group by Taxonomy Term, for example by print size: A4 or A5 so the list will look like as follows... 我有2种内容类型,一种是小册子,另一种是产品卡,我创建了一个将这2种分组在一起的视图,但是我还需要按分类术语进行分组,例如按打印尺寸:A4或A5,因此列表如下所示...

Brochures (A4) 宣传册(A4)

  • Item #1 项目#1
  • Item #2 项目#2
  • item #3 项目#3

Product Cards (A4) 产品卡(A4)

  • Item #1 项目#1
  • Item #2 项目#2
  • item #3 项目#3

Product Cards (A5) 产品卡(A5)

  • Item #1 项目#1
  • Item #2 项目#2
  • item #3 项目#3

Is there a solution for this or would i need to preprocess that view? 是否有解决方案,或者我需要对该视图进行预处理?

To fix this i used 2 views and set them as blocks to add on the same page. 为了解决这个问题,我使用了2个视图并将它们设置为要添加到同一页面上的块。

Firstly, got items by content type which displayed all my items needed. 首先,按内容类型获取项目,显示我所有需要的项目。 Secondly, set view to show individual fields, this way i could group by taxonomy term which got my desired view. 其次,将视图设置为显示各个字段,这样我就可以按分类术语将其分组,从而得到所需的视图。

It was simple enough, i was probably over complicating. 这很简单,我可能太复杂了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM