Drupal 7视图 - 按字段列表 [英] Drupal 7 Views - list group by field

查看:139
本文介绍了Drupal 7视图 - 按字段列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个查看列表内容的类型生物(人物的传记)。但是,我想格式化它们,以便它们分组在不同的标题下。

I have a View that list content of type Bio (the biographies of people). However, I would like to format it so that they are grouped under different headings.

我向 Bios添加了一个新字段内容类型是具有三个不同选项的下拉列表 - Foo 巴兹。我想做的是在各自组的标题下显示人物。

I added a new field to the Bios content type which is a dropdown list with three different options - Foo, Bar and Baz. What I want to do is display the people under the heading of their respective group.

目前:

- John Doe
- Jane Doe
- Jack Doe
- Juanita Doe
- Jim Doe

我想要的:

#Foo
- John Doe
- Jane Doe

#Bar
- Jack Doe
- Juanita Doe

#Baz
- Jim Doe


推荐答案

你应该可以做分组只是在视图内。不需要触摸模板。

You should be able to do the grouping simply within views. No need to touch the template.

以下是分组的方法:


  1. 添加该字段是下拉到您的视图中的字段列表。如果您不想与每个人一起显示(只是想显示在顶部),请确保在设置字段时选择从展示中排除

  2. 单击以配置视图格式的设置。我在我的例子中使用'Unformatted list',但这可能是一个html列表或一个表...


  1. 选择你现在在你的视图中的字段(即使你没有显示它)作为你的分组字段!

无论如何让我们知道如果它适用于你。

That should be it! Let us know if it works for you.

这篇关于Drupal 7视图 - 按字段列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆