我可以有一个随机块和一个排序页面吗?

发布于 2024-07-14 01:00:57 字数 268 浏览 4 评论 0原文

我一直遇到同样的问题,而且我觉得我正在以笨拙的方式解决它。 您有更好的解决方案吗?

我有一个内容类型为“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

零時差 2024-07-21 01:00:57

不,这在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文