开发者

Drupal, Views: Search FIlter, how can I ignore some nodes?

I'm using "Search" exposed filter in Views (DRupal):

It works great, however I would like to ignore a specific node, if it is possible, and always display it, regardless the filter options.

how can I do that ? Is poss开发者_如何转开发ible to specify the Search filter for only a specific content type ?

thanks


Here's what to do:

Add a new display to your view that is an attachment view. In the attachment, override all of your other filters etc and set up the view so that it just loads the single node that you want. Attach this view to the top or bottom of your search view as required.

In your search view, add an argument of node id and hard code a default argument that is the id of the node you display in the attachment. Exclude this argument from the view.


Finbarr's answer is pretty solid. The one thing its missing is the answer to whether you can exclude a specific content type from the search view... yes, you can.

On the display that is your search view, add a Node: Type filter and select "Is not one of" and the content type you want to exclude.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜