多个节点引用,显示与节点引用一样多的原始节点

发布于 2024-09-29 14:11:28 字数 1065 浏览 10 评论 0原文

我有 2 个用 CCK 制作的自定义类型:

  • Reunion
    • 标题
    • 描述
    • 对来宾的节点引用(多个)
  • 来宾
    • 姓名
    • 图片
    • 简历

在留尼汪岛 我有一个对来宾的多节点引用。 (我可以在留尼汪岛拥有多名客人)。

我想像这样打印(使用视图):

Reunion 1
 Description of the reunion 1
 Guests :
  * Guest 1
  * Guest 2
  * Guest 3

Reunion 2
 Description of the reunion 2
 Guests :
  * Guest 2
  * Guest 3

但是通过视图打印的唯一方法似乎是

Reunion 1
 Description of the reunion 1
 Guests :
  * Guest 1
Reunion 1
 Description of the reunion 1
 Guests :
  * Guest 2
Reunion 1
 Description of the reunion 1
 Guests :
  * Guest 3

Reunion 2
 Description of the reunion 2
 Guests :
  * Guest 2
Reunion 2
 Description of the reunion 2
 Guests :
  * Guest 3

我当然尝试了视图参数中的 Distinct 选项,但不幸的是,它只显示我

Reunion 1
     Description of the reunion 1
     Guests :
      * Guest 1

Reunion 2
     Description of the reunion 2
     Guests :
      * Guest 2

并且显然跳过之后的其他客人第一个。 有什么简单的解决办法吗?

谢谢 !

I have 2 custom type made with CCK :

  • Reunion
    • Title
    • Description
    • Node reference to Guests (multiple)
  • Guests
    • Name
    • Picture
    • Biography

In Reunion I have a multiple node reference to Guests. (I can have multiple Guest in Reunion).

I would like to print (using views) like this :

Reunion 1
 Description of the reunion 1
 Guests :
  * Guest 1
  * Guest 2
  * Guest 3

Reunion 2
 Description of the reunion 2
 Guests :
  * Guest 2
  * Guest 3

But the only way to print through views seems to be

Reunion 1
 Description of the reunion 1
 Guests :
  * Guest 1
Reunion 1
 Description of the reunion 1
 Guests :
  * Guest 2
Reunion 1
 Description of the reunion 1
 Guests :
  * Guest 3

Reunion 2
 Description of the reunion 2
 Guests :
  * Guest 2
Reunion 2
 Description of the reunion 2
 Guests :
  * Guest 3

I have of course tried the Distinct option in the view parameter, but unfortunately, it only show me

Reunion 1
     Description of the reunion 1
     Guests :
      * Guest 1

Reunion 2
     Description of the reunion 2
     Guests :
      * Guest 2

And apparently skip the other Guests after the first one.
Is there any simple solution ?

Thanks !

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撧情箌佬 2024-10-06 14:11:28

尝试节点:不同和“分组多个值”

编辑:好的,这让我很好奇,所以我尝试重新创建您的场景:

节点类型1:团聚
字段:标题(默认 Drupal)、描述(文本字段多行)、Guest(对 Guest 的节点引用,多个值)

节点类型 2:Guest
标题(用作名称 - 否则您将不得不使用关系来显示其他字段)、其他字段。

然后创建类型为node的View
默认情况下,选择样式 - 无格式、行样式 - 字段。添加字段“标题”、“内容:描述”、“内容:访客”(作为节点的链接)。确保在“访客”字段中选中对多个值进行分组选项(默认情况下启用它,但我实际上必须重新检查它才能使其处于活动状态)。在过滤器中,选择节点:已发布并按节点类型 = Reunion 进行过滤。运行预览看看它是否工作(应该)。

现在创建页面视图并为其指定路径“reunions”。如果您转到路径“团聚”,它应该按要求将多个字段分组在一起。

Try node:distinct and "group multiple values"

Edit: Ok, this made me curious, so I tried to recreate your scenario:

node type 1: Reunion
Fields: Title(default Drupal), Description(textfield multiple rows), Guest (nodereference to Guest, multiple values)

node type 2: Guest
Title (used as name - otherwise you'll have to use relationships to show other fields), other fields.

Then create View of type node
In the defaults, choose Style - Unformatted, Row Style - Fields. Add fields Title, Content: description, Content: Guest (as link to node). Make sure that Group multiple values option is checked for Guest field (it's enabled by default but I actually had to recheck it to make it active). In the Filters choose Node: Published and filter by Node Type = Reunion. Run preview to see if it's working (it should).

Now create Page View and give it path "reunions". If you go to path "reunions" it should be working as required grouping multiple fields together.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文