1

I have some fields (say, pictures or whatever) in my custom content-type and I want them to appear in search results. How do I do that?

I know how to edit template files such as search-result.tpl.php provided by the search module. In this page, there is a single variable called $snippet which contains search result but as a rendered HTML output. How do I modify it/show my custom fields in search results?

I would like to have full control to contents of the files, rather than just rendered HTML for them. My Search display page requires customization a lot, so without getting each field individually, I won't be able to produce desired output.

0

2 Answers 2

1

Try the Display Suite module. There you can change the appereance of a content type in different view modes. One of these view modes is for example the search result.

0

This page shows the info you need to customize the indexing of your fields.

As for the output, this one should lead you on the correct path.

2
  • How does hook_search_preprocess take me to correct path?!
    – Shafiul
    Commented Apr 3, 2012 at 6:46
  • I mean : the path to follow to learn how to customize your result page.
    – Countzero
    Commented Apr 3, 2012 at 6:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.