Hi there!

I have a site that users can post photos. When i´m making a search, I can see only the title of the search and more irrelevants things, like comments...

Let me explain...
In my content type, users have Photo (imagefield), description, title and tags.

Imagine that the one user post a beautiful house, so in tags he put "house".

when I search from "house", I can see the node that have house in tag (it is already ok).

But i need to put a small thumbnail of this house in the search result (using imagecache).

How can I do this?

Comments

epicflux’s picture

The Drupal Theme API allows you to theme individual search results.

Then follow the directions in the imagecache module for inserting the code for processing an image.

zanforlin’s picture

Hi! I made a template, but cannot see anything related with the content of the node on that search-result.tpl.php template.

How can I get the image, if the possible variables didn´t show anything relatede with the node content?

Thanks again

epicflux’s picture

You'll also want to check out this function: template_preprocess_search_result

This post seems to cover working with node data in search results well. I think you'll find the answer there, not in the first post, but in the follow-up comments.

bwv’s picture

Another way is to create a view with the views module. For fields, insert title and image; for filter, use the content type. This way you also will have fine granular control over the search results' display .
----------------------------------------------------------------------
http://music.bwv810.com
http://davidhertzberg.com

I am a writer, researcher and solo drupal freelancer.

zanforlin’s picture

Hi! Thanks for reply...

And how can I put the search result to show that view?

bwv’s picture

You need to create the view, and it is the view that will show the search results. To create the view, you need to upload the Views module to your site, and take it from there.
----------------------------------------------------------------------
http://music.bwv810.com
http://classicvinyl.biz
http://davidhertzberg.com

I am a writer, researcher and solo drupal freelancer.

doktorrr’s picture

I don't understand. How to make standard search form on my drupal site to show views module with custom search results instead regular search results which I have now.