view2 构建路径的多个参数

发布于 2024-12-26 19:02:59 字数 405 浏览 6 评论 0原文

我已经找到了通常的嫌疑人。进行分类,例如:

+Guys
--Core Collection
--New Arrivals
-- etc, etc
+Girls
--Core Collection
--New Arrivals
-- etc, etc
+Sale Items

您在这里明白了。 不管怎样,我有分类菜单构建路径(带有路径别名),例如“/collection/guys/core-collection/some-clothing-name”。我想构建一个自定义视图,以便路径显示带有分类术语的视图,因为它们是要过滤的参数。有人知道如何从 url 中传递 2 个参数来过滤掉衣服吗?现在尝试构建我自己的模块,但似乎我可能必须走这条路。

理想情况下,我想要“collection/%/%”。感谢您的帮助。

I have the usual suspects in place. Have taxonomy such as:

+Guys
--Core Collection
--New Arrivals
-- etc, etc
+Girls
--Core Collection
--New Arrivals
-- etc, etc
+Sale Items

You get the idea here.
Anyway, i have taxonomy menu building paths (with path alias) like "/collection/guys/core-collection/some-clothing-name". I want to build a custom view so that the path displays the view with taxonomy terms as they arguments to filter on. Anyone have any information on how to pass 2 arguments from the url to filter out the items of clothing? trying now to have to build my own module but it seems i may have to go down that road.

ideally, i'd like to have "collection/%/%". Thanks for the help.

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

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

发布评论

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

评论(2

雅心素梦 2025-01-02 19:02:59

您必须将术语名称转换为术语ID。我不会将解决方案归功于此,但有一篇文章描述了如何解决从 term nameterm 的转换ID

Rafael 已经建议了如何处理路径别名,所以我认为该章已涵盖。

来源:http://groups.drupal.org/node/8500

You'll have to convert the term names to term IDs. I'm not going to take credit for the solution but there is a post where it describe how you can solve the transformation from term name to term ID.

Rafael already suggested how to approach the path alias, so I think that chapter is covered.

Source: http://groups.drupal.org/node/8500

睫毛溺水了 2025-01-02 19:02:59

让我看看我是否理解。例如,您想要一个视图来显示“家伙/核心收藏”类别中的所有项目,对吧?看看这是否有效:

  1. 启用视图模块默认附带的“分类”视图(以分类/术语/%作为参数的视图)
  2. 使用“pathauto”模块为该词汇表的每个分类术语配置路径别名是“collection/[catpath-raw]”,这样你就可以将整个术语层次结构渲染到别名中,
  3. 就是这样,你只需要链接到“taxonomy/term/(tid)”,别名就是自动显示于网址。这也适用于网站上该词汇表术语的每个链接。

Let me see if I understand. You want a view to show, for example, all items on the guys/core-collection category, right? See if this works:

  1. Enable the "taxonomy" view that comes by default with the views module (the one that takes taxonomy/term/% as arguments)
  2. Configure the path alias for every taxonomy term of that vocabulary using the "pathauto" module to be "collection/[catpath-raw]", this way you'll get the whole term hierarchy rendered into the alias
  3. That's it, you'll just need to link to "taxonomy/term/(tid)" and the alias will be automatically displayed on the URL. This will also work on every link for a term of that vocabulary on the site.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文