显示drupal视图两次
我在 drupal 中有一个视图,我想以不同的方式显示两次。
我正在创建两个内容滑块。它看起来像一个使用 SlideDeck 的画廊。我有一个滑块显示内容的详细显示,另一个滑块是缩略图视图,单击时会更改第一个滑块。此功能类似于 ESPN 或 WWE.com 主页上的滑块。
我的视图连接到节点队列。
它看起来像:
<div id="slide-contain">
<div id="slide1">
<dl>
<dd>
cycle through the view
<?php print $rows; ?>
</dd>
</dl>
</div>
<div id="slide2">
<dl>
<dd>
cycle through the view again
<?php print $rows; ?>
</dd>
</dl>
</div>
</div>
I have a view in drupal that I would like to display twice, in different ways.
I'm creating two content sliders. It looks like a gallery using SlideDeck. I have one slider that displays a detailed display of the content and the other slider is a thumbnail view that when clicked, changes the first slider. This functions similar to the slider on the homepage of ESPN or WWE.com.
The view I have is connected to a nodequeue.
it would look something like:
<div id="slide-contain">
<div id="slide1">
<dl>
<dd>
cycle through the view
<?php print $rows; ?>
</dd>
</dl>
</div>
<div id="slide2">
<dl>
<dd>
cycle through the view again
<?php print $rows; ?>
</dd>
</dl>
</div>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
抱歉,我的回答有点含糊,因为我从未使用过您正在使用的滑块。
如果您希望以两种不同的方式获得相同的视图,您可能需要查看视图附件显示。这将允许您为缩略图创建单独的显示,然后将其附加到常规缩略图上。然后,您可以将其设置为在主视图之前渲染,这基本上会迭代视图两次。
我试图找到一个很好的解释者,但找不到太多。如果您安装常见问题解答模块,它安装的视图将使用附件来呈现经典的“顶部问题”显示。
FWIW我使用 Awkward Showcase 和视图做了类似的滑块。我喜欢它,因为没有必要先遍历缩略图,然后遍历主要内容。相反,每段内容都包含在一个 div 中,允许我为单行设置主题。
Sorry, my answer is going to be a bit vague because I've never used the slider you are using.
In your situation where you want the same view 2 different ways, you might want to look at Views Attachment Displays. This will allow you to create a separate display for your thumbnails and then attach it to your regular one. You can then set it to render before the main view which would basically iterate the view twice.
I tried finding a good explainer on them, but couldn't find much. If you install the FAQ module, the views it installs use attachments to present the classic "questions on top" display.
FWIW I did a similar slider using Awkward Showcase and views. I liked it because it wasn't necessary to first iterate through the thumbnails, and then iterate through main content. Instead each piece of content was contained within a single div, allowing me to theme a single row.