Drupal 7:视图:根据相关分类和用户字段显示内容
我正在尝试使用 Drupal 7.8、Views 7.x-3.0-rc1 和 References 7.x-2.x-dev 创建一个复杂的视图。
Drupal 实例包含以下内容:
词汇:
- 邮政编码:术语是邮政编码列表,其中包含“耐寒区”的分类参考字段
- 耐寒区:术语是耐寒区列表
内容类型:
- 植物:内容包含“耐寒区”的分类参考字段“坚固区”(不止一个)。
用户:
- 邮政编码(分类参考字段):用户从分类“邮政编码”中选择邮政编码(用户目前只能选择一个)。
我将该视图称为“我的位置”。我希望它向我显示具有与用户的“邮政编码”相匹配的“耐寒区”的“植物”。
我尝试创建一个用户视图(不起作用):
- 当前用户的“邮政编码”的上下文过滤器
- 高级过滤器显示“邮政编码”的“耐寒区域”
- 高级过滤器仅显示“耐寒区域”中具有“耐寒区域”的节点’
我可能会弄错一些因素或整个该死的事情,有人能提供建议吗?我应该以不同的方式处理这个问题吗?
I'm trying to create a complex view using Drupal 7.8, Views 7.x-3.0-rc1, and References 7.x-2.x-dev.
The Drupal instance contains the following:
Vocab:
- Zip Code: terms are a list of zip code with a taxonomy reference field to 'Hardiness Zones'
- Hardiness Zones: terms are a list of Hardiness Zones
Content Type:
- Plants: content contains taxonomy reference field to 'Hardiness Zones' (more than one).
User:
- Zip Code (Taxonomy Reference Field): users selects their Zip Code from the taxonomy 'Zip Codes' (user can only select one at the moment).
I'm calling the view 'my location'. I want it to show me "Plants" that have a matching "Hardiness Zone" to the User's "Zip Code".
I tried creating a user view (did not work) with:
- contextual filter for current user's 'zip code'
- advanced filter to show 'hardiness zones' for 'zip code'
- advanced filter to only show nodes with 'hardiness zones' from 'hardiness zones'
I might be getting some factors wrong or the whole dang thing, would anyone be able to advise? Should I be approaching this differently?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您不希望它变得“花哨”:) 您可以只公开邮政编码过滤器并允许用户手动输入它。如果他们想在其他地方寻找植物,这也会有所帮助。
If you did not want it to be "fancy" :) You could just expose the zip code filter and allow the user to enter it manually. This would also help if they wanted to find the plants for another location.