Drupal 7 视图按节点的分类术语过滤

发布于 2024-12-04 10:16:59 字数 343 浏览 0 评论 0原文

我有一个与上一个类似的问题(Drupal 7 视图按动态过滤分类学术语),情况正好相反。

我有一个“合作伙伴”内容类型,每个内容类型都有自己的分类术语。另一种内容类型是包含“合作伙伴”词汇表中的多个术语的常规页面。在我的常规节点中,我想在视图块中包含一些“合作伙伴”。

该视图应仅过滤那些相关的合作伙伴节点(那些标有常规节点标签之一的节点)。

可以这样吗?问题是我无法通过上下文过滤器从 URL 获取术语名称...

I have a similar question to my previous one (Drupal 7 views filter by dynamic taxonomy term), it's only the other way round.

I have a "partner" content type, each with it's own taxonomy term. The other content type is a regular page with multiple terms from the "partner" vocabulary. In my regular nodes, I want to include a few of the "partners" in a view block.

The view should filter only those relevant partner nodes (those tagged with one of the regular node's tags).

Could it be done this way? The problem is that I can't get the term names from URL via contextual filters...

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

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

发布评论

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

评论(1

盛装女皇 2024-12-11 10:16:59

经过整个下午的谷歌搜索(并将其发布在那里),我最终找到了答案。

它基于 scito.ch(谢谢),仅进行了一些修改。在内容:具有分类术语 ID(带深度) 过滤器上,请务必选中允许多个值复选框。另外(对此有很多错误的说法),不要在WHEN THE FILTER VALUE IS AVAILABLE OR A DEFAULT IS PROVIDED中指定任何内容。指定所有这 3 个上下文过滤器非常重要。

希望这可以帮助某人并为他节省一个阳光明媚的下午:)

After googling the whole afternoon (and posting it there), I eventually found the answer.

It's based on a tutorial on scito.ch (thanks), with only a few modifications. On the Content: Has taxonomy term ID (with depth) filter, be sure to check the Allow multiple values checkbox. Also (there's a lot of wrong tuts for that), don't specify anything in the WHEN THE FILTER VALUE IS AVAILABLE OR A DEFAULT IS PROVIDED. It's important you specify all those 3 contextual filters.

Hope this helps someone and saves him a sunny afternoon :)

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