views:

251

answers:

2

Hi,

I'm using Views in Drupal.

I want an exposed filter selecting the ndoes containing a specific word. But I noticed I cannot search more then one CCK field per filter.

Since I want to expose it, I want an unique text-input field for all CCK Fields: is that possible ?

At the moment I can only add a new filter for each CCK field.

Thanks

+1  A: 

You can use the CCK module Computed Field.

Setup the field so that it stores all the text from all the other fields, then you can filter on this one field (and effectively filter on all fields).

See this code snippet for merging multiple fields into one.

vfilby
so, the only solution is to add another CCK field to my nodes and use php to copy all the content there ?
Patrick
There could be a better solution, but I am not aware of it. What you are doing seems really close to search, is there any reason you don't want to use the built in search or some of the better search modules out there?
vfilby
yeah I could maybe use search. I'm using a personalized View in my website and added to it some javascript functionalities, so I guess if i run Search I'm going to use another View.. that's the main reason.
Patrick
If this is just search, I would suggest trying to use the core search module (or one of the other feature rich search modules) rather than trying to duplicate it with views. Performance will be much better with proper search.
vfilby
ok cool, so I should work on the code, or find some module to customize search view. thanks
Patrick
yeah ok, but I need to customize the search results like my view. I guess this is double work..
Patrick
A: 

I've actually found the item "Search" in my Filters options in Views. I dunno how I could ignored it before. It actually exists, and works quite well. Solved.

Patrick