简体   繁体   English

Drupal:我可以在网站块中放置一个视图过滤器(搜索项)吗?

[英]Drupal: can I place a views filter (Search items) in a website block?

I'm using Drupal and in the "Filters" list there is also the "Search Term" filter which works great. 我使用的是Drupal,在“过滤器”列表中也有一个“搜索字词”过滤器,效果很好。

I use it to search a specific node in my Views list. 我用它来搜索“视图”列表中的特定节点。

However such field only displays when I'm in the view page, but I would like to display on any page of my website (let's say as a block) (and when I search for something, the view page is loaded with the filtered nodes. 但是,仅当我在视图页面中时才会显示该字段,但是我想在我的网站的任何页面上显示(假设是一个块)(并且当我搜索某些内容时,视图页面会加载经过过滤的节点。

Do you know how could I make it ? 你知道我怎么做吗? thanks 谢谢

In your view configuration page there should be a field: Exposed form in block. 在视图配置页面中,应该有一个字段:块中的公开表单。 If this is checked then views will create a block with the filters on it rather than embedding it in the view itself. 如果选中此选项,则视图将在其上创建带有过滤器的块,而不是将其嵌入视图本身。 This block can be placed from the block configuration screen and you can make it show on any pages that you want. 可以在块配置屏幕上放置该块,然后将其显示在所需的任何页面上。

I think the option lived under the Filter section in Views 2, in Views 3 it's in its own place called Exposed Form. 我认为该选项位于视图2的“过滤器”部分下,位于视图3中的它自己的位置,称为“暴露形式”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM