[英]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.