按下拉列表对视图进行排序
嘿,我一直在为 Drupal 中的视图寻找 ajax 下拉排序器。
不幸的是,我没有找到很多关于这个主题的有用信息。
谁能告诉我是否有可用的解决方案,或者可以通过告诉我应该使用哪些钩子来帮助我开始自定义模块?
Hey, i've been looking around for a ajax dropdown sorter for my Views in Drupal.
Unfortunatly, i haven't found alot of usefull information about this subject.
Can anyone tell me if theres a solution already available or can help me started on a custom module by telling me which hooks i should use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我有类似的问题。不幸的是,我无法对数据库中的数据进行排序,这是迄今为止最好的方法。然而,我能够使用 PHP 的预处理器函数获取数据并对其进行排序。根据视图的名称,设置类似于以下的功能:
视图的名称需要遵循其驱动的模板文件的名称,如果没有,您应该创建一个。确保将函数名称中的破折号更改为下划线。希望这有帮助。如果你找到一种方法从数据库中做到这一点,我会洗耳恭听,因为那将是超级棒的。
I had a similar issue. Unfortunately I wasn't able to sort the data from the database which is by far the best way. I was however able to take the data and sort it with PHP using a preprocessor function. Depending on the name of your view, setup a function similar to the following:
The name of your view needs to follow the name of the template file that it is driven by, if there isn't on you should create one. Make sure to change dashes to underscores in your function name. Hope this is helpful. If you find a way to do it from the DB I'm all ears because that would be super awesome.