简体   繁体   English

视图:排除具有与当前节点相同的分类术语ID的节点

[英]View: Exclude nodes that have the same taxonomy term id(s) as current node

Drupal 8 Drupal 8

I have a content type with a field that holds a Taxonomy Term Reference . 我有一个内容类型,其中的字段包含“ Taxonomy Term Reference I want a View that shows other nodes of the same content type that do not have that field with the same Taxonomy Term ID as the currently viewed node. 我想要一个视图,以显示具有相同内容类型的其他节点,这些节点没有与当前查看的节点具有相同分类标准项ID的字段。

Example: 例:

URL: / story/storyA URL:/ 故事/ storyA

Currently viewing a node of Content Type Story that has a Taxonomy Term Reference to value B . 当前正在查看Content Type Story的节点,该节点的Taxonomy Term Reference值B。 I need the view to show other stories that do not have that same Taxonomy Term Reference to value B . 我需要显示其他故事, 这些故事没有B相同的Taxonomy Term Reference

I thought I could achieve that by 我以为我可以做到

  • Set up a relationship to the field that holds the Taxonomy Term relationship保存分类法术语的字段建立relationship
  • Add a Filter Criteria of Term ID associated to above relationship and with operator is not equal to . 添加与上述关系相关联且与运算符不等于术语ID Filter Criteria PROBLEM: how do I get the token for Value? 问题:如何获得价值代币?

在此处输入图片说明

I also tried to go about adding a Contextual Filter associated to the created relationship and selecting Exlude but no dice. 我还尝试着添加与创建的关系相关联的Contextual Filter ,然后选择Exlude但没有骰子。

在此处输入图片说明

I finally figured it out, I was missing the adequate additional Contextual Filter : 我终于弄清楚了,我缺少足够的附加上下文过滤器

  • Term ID , Provide default value with Taxonomy term ID from URL and the options Load default filter from node page and limit terms by vocab checked. Term IDProvide default value其中包含Taxonomy term ID from URL以及选项Load default filter from node pagelimit terms by vocab选中limit terms by vocab And the last bit, in More , I have Exclude checked. 最后一点,在More ,我已经检查了Exclude This contextual filter is associated to the created relationship mentioned in the question. 此上下文过滤器与问题中提到的已创建关系相关联。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM