简体   繁体   English

Drupal视图路径和分类术语

[英]Drupal view path and taxonomy term

I have two taxonomy dictionary: location, type. 我有两个分类词典:位置,类型。 I need view that path will be like show/location/type and view show of specific location and type 我需要查看路径将类似于show / location / type并查看特定位置和类型的show

It sound like you might want to use contextual filters in your view (in the advanced tab). 听起来您可能想在视图中(高级选项卡中)使用上下文过滤器 This way you should be able to pass filter values to your view in the view path. 这样,您应该能够将过滤器值传递到视图路径中的视图。

Depending on what you're trying to achieve you may need to try different settings. 根据您要实现的目标,可能需要尝试其他设置。 If I understand correctly and your "location" and "type" in view path are term names, you will need something like this: 如果我正确理解并且您在视图路径中的“位置”和“类型”是术语名称,则将需要以下内容:

  • Under "Provide default value" select Raw Value from URL and path component 在“提供默认值”下,从URL和路径组件中选择原始值
  • Under the form "When the filter value IS in the URL or a default is provided" select the option "Specify validation criteria" 在“当提供URL中的过滤器值IS或默认值时”形式下,选择选项“指定验证条件”
  • Select "Taxonomy Term" as the Validator 选择“分类术语”作为验证者
  • Select your vocabulary 选择你的词汇
  • Under "Filter Value Type" select "Term name converted to term ID" 在“过滤器值类型”下,选择“术语名称转换为术语ID”
  • Check "Transform dashes in URL to spaces in term name filter values" 选中“将URL中的破折号转换为术语名称过滤器值中的空格”

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

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