视图不显示复选框字段,其中答案为& gt;1个 [英] Views doesn't show checkbox fields where answer > 1

查看:56
本文介绍了视图不显示复选框字段,其中答案为& gt;1个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Drupal与Views一起使用,并激活了扩展配置文件模块.为了使用户能够检查多个感兴趣的领域,我还添加了一个名为个人资料"复选框的模块.它增加了使用自由格式列表的功能,但可以将其变成复选框或单选按钮.

I am using Drupal with Views and the extended profiles module activated. To enable users to check multiple areas of interest I also added a module called Profile Checkboxes. It adds the ability to use a free-form list but turns it into either check boxes or radio buttons.

此模块工作非常干净,没有出现错误.但是,如果用户检查多个兴趣,那么这些兴趣将作为逗号分隔的值存储在 profile_values 表中.

This module works very cleanly and did not present errors. But if a user check multiple interests then those are stored in the profile_values table as a comma seperated value.

因此,如果用户喜欢,可以说汽车,卡车和自行车.将其存储在数据库的一个字段中,如下所示:

So if the user likes lets say cars, trucks and bikes. That is stored in one field of the database as:

+-----+-----+---------------------+
| fid | uid | value               |
+-----+-----+---------------------+ 
| 12  | 32  | cars, trucks, bikes |
+-----+-----+---------------------+

我希望能够为我正确地解析视图,以便我可以创建仅显示已输入兴趣的用户的过滤器.它给我的选项是验证是否选择了列表中的值,然后选择了列表中的所有值.但是,它仅显示已检查其中一个值的用户.我希望这是有道理的.

I want to be able to have views parse this correctly for me so that I can create filters that only shows users who have entered an interest. The options it gives me is to validate "if ant of" the values in the list is chose, I selected all the values in the list. But it only shows the users who have check one of the values. I hope it makes sense.

我是否需要在自定义tpl文件中编写代码,还是可以通过Views完成此操作?

推荐答案

您可以对视图进行操作,但是在这种情况下,不使用视图可能会更简单,除非您非常了解视图API.

You can do it with views, but in this case it will probably be a lot simpler to do it without views, unless you know the views API very well.

这篇关于视图不显示复选框字段,其中答案为& gt;1个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆