Need custom search results for only one content type

Katrina B's picture

I am in the final stages of building a Drupal/ProsePoint site for a small daily newspaper. We are using the Feeds module to bring in our daily Classifieds, which populate as individual nodes. I found a way to create a custom search block for Classifieds -- -- so that users can search only Classifieds and not the entire site.

But I need a way to customize the display of those results ... without changing the way that search results are displayed for any other content type! (Specifically, I need to display only the Body, not the Title or Author or Date or any other info.) I've read quite a few postings about how to customize search results site-wide ... but I just need to customize the search results for the Classifieds content type, not anything else.

Any ideas? Thoughts? Suggestions?


Have looked at display suite?

shrimphead's picture

Have looked at display suite?
it will allow you to chnage the look and feel of specific nodes depending on viewing teaser, full node or searched view.

You can do that by modifying

amonika's picture

You can do that by modifying the "search-result.tpl.php" file in /modules/search directory.

if ($info_split['type']=="your_content_type") : ?>

//do the theming here - this will show $snippet for all content types and $info for all content types except for your_content_type
  <p class="search-snippet"><?php print $snippet;?></p>
<?php elseif ($snippet): ?>
  <p class="search-snippet"><?php print $snippet;?></p>
  <p class="search-info"><?php print $info; ?></p>
<?php endif; ?>

Hope this helps!