当节点包含两个多值字段时,视图会重复字段。
这是我的设置:
我定义了一个节点类型,其中包含多值文件字段(“field_myfilefields)”和多值 emvideo 字段(“field_myemvideos”)。 我创建了一个这种类型的节点,并(例如)用两个文件字段和三个 emvideo 填充它。 我定义了一个视图,其中包含以下字段:field_myfilefields、field_myemfields。
我想要的:
在此示例中,我希望视图创建五行,每行一个视频。
我得到的结果:
Views 创建 6 行,其中每行包含一个文件字段和一个 emvideo 字段:
- row 0: filefield 0, emvideo 0
- row 1: filefield 0, emvideo 1
- row 2: filefield 0, emvideo 2
- row 3: filefield 1 , emvideo 0
- row 4: filefield 1, emvideo 1
- row 5: filefield 1, emvideo 2
也就是说,视图循环浏览文件字段,并且对于每个文件字段在 emfield 之间循环。每个视频都会显示两次。我可以理解为什么视图会这样做,但这不是我想要的,我希望这是一个解决方法。
关于如何强制每行一个视频并避免重复视频有什么建议吗?
PS 我尝试尝试视图的“分组多个值”复选框。但这并没有解决问题。
Here is my set-up:
I define a nodetype that contains both a multi-valued filefield ("field_myfilefields)" and a multi-valued emvideo field ("field_myemvideos").
I create a node of this type, and (eg) populate it with two filefields and three emvideos.
I define a view, with these fields: field_myfilefields, field_myemfields.
What I would like:
In this example, I would like views to create five rows, with one video per row.
What I get:
Views creates 6 rows, where each row contains both a filefield and an emvideo field:
- row 0: filefield 0, emvideo 0
- row 1: filefield 0, emvideo 1
- row 2: filefield 0, emvideo 2
- row 3: filefield 1, emvideo 0
- row 4: filefield 1, emvideo 1
- row 5: filefield 1, emvideo 2
That is, views cycles through the filefields, and for each filefield cycles through the emfields. Each video gets displayed twice. I can understand why views does this, but it is not what I want and I am hoping this is a work-around.
Any suggestions on how I can enforce one video per row, and avoid duplicate videos?
P.S. I tried experimenting with views' "group multiple values" checkbox. But that did not solve the problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我记得在 Drupal 6 的视图 2 中,有一个“独特”的视图设置,专门用于此目的。
I recall that in Views 2 for Drupal 6 there is a "distinct" setting for the view, which is intended solely for that purpose.