views:

106

answers:

2

hi,

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 possible to specify the Search filter for only a specific content type ?

thanks

+3  A: 

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
+1  A: 

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.

Chaulky
Forgot to give that part of the answer :-)
Finbarr
no, I'm using a search Filter inside my View (if you search in the filters list you'll find "Search"). I'm not using another Search View. So I would like to apply that filter to specific content types, but keep my view general for all. (In other words, always showing the articles of content type A, and filter (Search) articles of content type B.
Patrick
I'm pretty sure the Search filter can be set to allow all nodes of a certain content type through, while actually filtering others. I think you'll have to take the approach in Finbarr's answer and display the node of content type A in an attachment view, either above or below the main view. In this case, the results will be separated by content type... it also adds to question of how to page through results, as there may be 5 pages of Type A nodes, and only 2 pages of searched Type B nodes
Chaulky

related questions