Drupal:如何在特定块中显示特定视图
假设我创建了一个显示某种故事的视图。 但我想在左侧栏中显示此视图 - 不是视图的链接,而是视图本身。
如何将我的新视图与固定块位置连接起来? 我希望能够在页面上的各个位置显示真实的视图数据。 是否有可能,或者我仅限于中心区域和菜单中视图的链接?
Let's suppose I have created a view that shows some kind of stories.
But I want to show this view in a left-hand bar — not a link to the view, but the view itself.
How can I connect my new view with a fixed block position?
I want to be able to show real view data in various places on my page.
Is it possible or I am limited only to central area and links to views from menu?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在块中显示视图很容易。 创建视图并将该视图分配为块位置后,您只需前往管理员中的块即可看到该视图。
只需选择该块并保存即可。 简单的。
如果您的视图未显示,请检查您的过滤器以及视图字段是否正确。 通常,如果他们没有显示,则很简单,例如选择
内容已发布=是
。Getting a view to display in a block is easy. Once you have created a view and assigned the view as a block position you simply head to blocks in your admin and you'll see the view.
Just select the block and save it. Simple.
If your view doesn't show, check your filters and that the view fields are correct. Usually if they are not showing it is something simple like selecting
content published = yes
.您可以将视图创建为页面或块。 由于您没有确切说明您正在使用哪个 Drupal/Views 版本,到目前为止我只能告诉您,在创建视图后,您可以告诉它显示为块或页面。
然后转到块设置并将其设置为您想要的位置。
You can create views as pages or blocks. As you're not telling exactly which Drupal/Views version you're working with, all I can tell so far is that, after you create the view, you can tell it to display as a block or as a page.
Then go to the blocks settings and set that to the position you want.
使用 Drupal 6.x 的 Views 2.x 可以很简单地从视图创建块。 每个视图都有一组“默认”设置和一些显示设置。 显示可以是页面、块、提要或创意模块创作的任何其他内容。
要从您的视图中创建一个块,您只需“添加显示”类型的“块”,覆盖您想要在块中更改的任何设置(IE - 显示较少的项目,仅显示节点标题,等等)。 然后您就拥有了一个可以像任何其他 Drupal 块一样放置的块。
编辑:回答“您能否将故事限制为已标记的故事”? 当然可以。 您只需添加分类术语的过滤器即可。
Using Views 2.x for Drupal 6.x it's simple to create a block from a view. Every view has a set of 'default' settings and some number of display settings. A display can be a page, a block, a feed or anything else that creative module authors.
To make a block from your view, you just "Add Display" of type "block", override any settings that you want changed in the block (IE - display less items, just a node title, whatever). You then have a block that you can place like any other Drupal block.
edit: Answer to "Can you limit stories to ones that are tagged"? Sure thing. You just add a filter for Taxonomy terms.