Drupal Views Attach - 使用字段将视图附加到视图
我正在使用这种出色的方法,使用“视图附加”和“节点参考 URL”模块(以及其他模块)将图像库附加到节点: http://www.lullabot.com/articles/photo-galleries-views-attach 。
运行良好。我现在想做的是创建一个预告项目页面,其中将附加画廊的单个图像版本。
为图像创建新的视图附件后,我可以使用使用行样式 = 节点的新页面视图来执行此操作,并且这有效(显示图像)。然而,这并没有给我使用 Row style = fields 允许的细粒度选项。
那么实际上是否可以将 Row style = fields 与视图一起使用并附加另一个视图?我认为可能有一个不错的“附加视图”字段可供选择...:)
编辑:我想我可以使用节点预告片的主题版本来删除一些我不想显示的节点元素(标签等)。将尝试...
干杯, 詹姆斯
I'm using this excellent method to attach an image gallery to a node using 'Views Attach' and 'Node Reference URL' modules (amongst others): http://www.lullabot.com/articles/photo-galleries-views-attach .
It's working fine. What I'm trying to do now is to create a page of teaser items that will have an attached single image version of the gallery.
After creating a new Views attachment for the image I can do this using a new page View that uses Row style = Node, and this works (the image is displayed). However this doesn't give me the fine grain options that using Row style = fields allows.
So is it actually possible to use Row style = fields with Views AND have another View attached to it? I thought there might have been a nice 'Attached view' field to choose... :)
Edit: I guess I can use a themed version of the node teaser to remove some of the node elements I don't want to show up (tags etc.). Will try that...
Cheers,
James
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需使用行构建视图即可。然后您可以覆盖该特定视图的视图模板(例如:views-view--yourviewname--block-1.tpl.php)。
在该模板中,您可以嵌入任何其他视图
例如:
Just build out the views using rows. Then you can override the view template for that particular view (ex: views-view--yourviewname--block-1.tpl.php).
Within that template you can embed any of your other views
ex:
<?php print views_embed_view('viewname','block_2')?>
您可以按照 Hunter Frazier 的建议进行操作,也可以将他的 PHP 代码片段作为 PHP 字段添加到视图设置中。通过这种方式,您不需要创建模板文件,因为视图输出被视为主视图的字段。
You can do what Hunter Frazier suggests, or you can add his PHP snippet as a PHP field to the view settings. In this way, you don't need to create a template file because the view output is considered a field of the primary view.