i need to create a block View with a search box attach to the header in order to search nodes for one specific content type. I don't know how to achieve this, so i ask for your help. Something like the attached photo.
4 Answers
I'm not exactly sure here, but it sounds to me like you want to:
Create a view; add a "filter" which limits the view to only your desired content type; add an "argument," and then expose this argument, for either title, body, or one of your text fields.
Unfortunately: This alone will not search the whole node. If most of your content is in body, this would probably be a good way to do it. But, for example, if for some reason you have a title like "Bicycles in Timbuktu" with a body that does not contain the word "Timbuktu" - were your users to search for Timbuktu, this item would not appear. That said, it's probably a rather rare case, and if you are simply aiming for happy users, and not rigorous perfection, this will likely be enough.
That said, Kniganapolke's suggestion of checking out Custom Search is excellent. The advice here is more applicable if you want to do this as you've designated and using the power you have with Views (and the other possibilities they offer), rather than a more dedicated-type module. If you don't have other specifications which require you to use Views, I'd guess that Custom Search will likely be the better solution.

- 661
- 7
- 16
create a view with the content you want and then filter it by content. Expose the filter. http://beeznest.wordpress.com/2011/11/01/create-a-view-to-search-on-content-title-in-7-steps-in-drupal-7/

- 6,203
- 2
- 31
- 39
If anybody is interested, i have edited the header block view and load a custom_search_block inside it.
Thanks anyway

- 5,800
- 11
- 66
- 94