简体   繁体   English

Drupal 7使用Views和Pathauto列出具有分类术语的用户

[英]Drupal 7 list users with taxonomy term using Views and Pathauto

I am attempting to create a taxonomy term page to display users tagged with a vocabulary "expertise" and not having much luck. 我正在尝试创建一个分类术语页面,以显示标记有词汇“专长”且运气不佳的用户。

I'm using pathauto to alias the taxonomy term pages with the following pattern: [term:vocabulary]/[term:name] . 我正在使用pathauto使用以下模式为分类术语页面添加别名: [term:vocabulary]/[term:name]

I then have a Views page for Users with the path set to /expertise/% and a contextual filter on "User: Expertise" (my taxonomy term field). 然后,我为用户提供了一个Views页面,其路径设置为/expertise/%并且在“ User:Expertise”(我的分类术语字段)上使用了上下文过滤器。 The filter takes the default value of "Taxonomy term ID from URL" and validates as a taxonomy term from the "Expertise" vocabulary. 过滤器采用默认值“来自URL的分类术语ID”,并根据“专业知识”词汇表作为分类术语进行验证。

However, if I then go to (for example) /expertise/php I appear to be getting the standard Drupal taxonomy page rather than the View page setup and see no user results. 但是,如果我转到(例如)/ expertise / php,则似乎正在获取标准的Drupal分类页面,而不是“查看”页面设置,并且看不到用户结果。

Any ideas how I can fix this? 有什么想法我可以解决这个问题吗? I have several taxonomies in use for both nodes and users so need to be able to distinguish between the vocabularies using the aliasing described above. 我有几个用于节点和用户的分类法,因此需要能够使用上述别名来区分词汇表。

That's what a contextual filter does... it takes over every page. 这就是上下文过滤器的作用……它将接管每个页面。

I'm confused as to why you aliased the term pages at all... it seems like you don't want to dispaly them, so why not just forget about the alias and set the view page to the url you want it to be at? 我对您为什么对术语页面完全使用别名感到困惑...似乎您不想散布它们,所以为什么不忘掉别名并将视图页面设置为您想要的网址在?

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

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