简体   繁体   English

基于自定义字段的Drupal实体参考

[英]Drupal Entity Reference based on custom field

I hope that this question has not yet been answered, but I searched through lots of topics and I didn't find an answer. 我希望这个问题尚未得到解答,但是我搜索了很多主题,但没有找到答案。

Here is the problem: I'm trying to link two nodes from different content types, and I'd like to use another field than the Title of the other node as a reference. 这是问题所在:我试图链接来自不同内容类型的两个节点,并且我想使用另一个字段(而不是另一个节点的标题)作为参考。

The reason I dont want to use the node's Title is because I'm currently building a website for a movie theater. 我不想使用节点的标题的原因是因为我当前正在为电影院建立一个网站。 I'm using Feeds to import movies and movie times from a xml file. 我正在使用Feed从xml文件导入电影和电影时间。 These are both represented by their own content type. 这些都由它们自己的内容类型表示。
Each movie has its own unique ID picked from a database, and this is the field I'd like to use for joining two nodes. 每部电影都有一个从数据库中选取的唯一ID,这是我想用来连接两个节点的字段。

The aim is to display a movie alongside its movie times (they are more than one movie time's node for one movie, because a movie can be seen in 3D/non 3D mode, VO/translated...). 目的是将电影与电影时间一起显示(对于一部电影,它们是一个电影时间的多个节点,因为可以在3D /非3D模式,VO /翻译的状态下观看电影)。

When I'm trying to use Entity Reference, I can't find a way to fill (for example) a text field with this unique movie's ID, in order to use it as a relationship in Views. 当我尝试使用“实体引用”时,我找不到用此唯一电影的ID填充(例如)文本字段的方法,以便将其用作“视图”中的关系。

I hope my problem and question are both understandable (excuse my English...), and that some of you could help me to find a solution. 我希望我的问题和问题都可以理解(请问我的英语...),并且你们中的一些人可以帮助我找到解决方案。
Thanks by advance 预先感谢

I solved this problem by grouping fields based on Film ID. 我通过基于Film ID分组字段解决了这个问题。 I'll just have a bit of templating to make in order to wrap my view's output to wrap all fields, but it shouldn't be a problem ;) 为了封装我的视图的输出以包装所有字段,我将做一些模板化工作,但这不是问题;)

You can switch the entity reference selection method to use a view instead of the "simple". 您可以切换实体引用选择方法以使用视图而不是“简单”视图。 You have to have views installed. 您必须安装视图。

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

相关问题 如何以编程方式在Drupal 8中创建实体引用字段? - How to create an entity reference field in Drupal 8 programmatically? Drupal 7:如何根据当前页面内容过滤视图内容(带有实体引用字段) - Drupal 7: how to filter view content (with entity reference field) based on current page content Drupal内容类型-通过实体参考填充“标题”字段 - Drupal content type - populate Title field via Entity Reference Drupal视图3-实体参考中缺少“多个字段设置” - Drupal views 3 - missing “MULTIPLE FIELD SETTINGS” in entity reference 通过自定义字段过滤的“节点引用”类型的Drupal字段 - Drupal field of type “Node Reference” filtered by custom field Drupal 8:呈现自定义实体及其自定义字段的正确方法? - Drupal 8: Correct way to render an custom entity and its custom field? Drupal 7:基于角色和关系/引用实体或类似的字段权限 - Drupal 7: Field Permissions based on role AND relationship/referenced entity or similar Drupal 7在路径自动模式中获取节点引用自定义字段 - Drupal 7 get node reference custom field in path auto pattern 用户资料中的Drupal 7实体参考 - Drupal 7 Entity Reference in User Profile 在Drupal 7中使用实体引用创建视图 - Creating view with entity reference in drupal 7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM