我可以有一个随机块和一个排序页面吗?
我一直遇到同样的问题,而且我觉得我正在以笨拙的方式解决它。 您有更好的解决方案吗?
我有一个内容类型为“Staff Bios”的网站。 我创建了一个视图页面,其中按字母顺序列出了所有 BIOS。 我想要一个只显示一个生物的块(如侧边栏预告片),并且我希望显示哪个生物的选择是随机的。
我一直在创建 2 个单独的视图,一页带有 sort = node>title,另一块带有 sort = random。 但这似乎很蹩脚。
想法? 谢谢!
I keep running into the same problem, and I feel like I'm solving it the clunky way. Do you have a better solution?
I have a site that with the content type "Staff Bios". I've created a view page that lists all the bios in alphabetical order. I want to have a block that shows just one bio (like a sidebar teaser), and I want the choice of which bio is displayed to be random.
I have been creating 2 separate views, one page with sort = node>title, and one block with sort = random. But that seems lame.
Thoughts? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,这在 Drupal 5 / Views 1 中是不可能的[*]。
在 Drupal 6 / Views 2 中,您可以选择创建多个视图“显示”,每个视图“显示”都可以进行自定义排序(除其他外)。
[*] 好吧,从技术上讲,您/可以/通过创建一个实现新的“视图类型”的模块来做到这一点,该模块在显示行之前随机化行(并为块选择该类型,并为页面选择正常的视图类型) ,但我鼓励您花精力将站点升级到 Drupal 6。
No, this is not possible[*] with Drupal 5 / Views 1.
With Drupal 6 / Views 2, you get the option to create multiple View "Displays", each of which can have customized sorting (among other things).
[*] Well, technically, you /could/ do it, by creating a module that implements a new "View Type" that randomizes the rows before displaying them (and select that for the Block, and the normal View Type for the page), but I encourage you to instead put the effort into upgrading your site to Drupal 6.