When I do a search in Drupal 5.x I want results to be the actual teaser for the nodes that are matches for the search results.

Currently I can only get text to show up in the results. I have nodes that have images in the teasers and it would be great to have the entire teaser to show up with the image when some one does a search.

Any ideas?

Thanks,
Gearhead
www.musclecarsociety.com

Comments

WorldFallz’s picture

have you seen this: search results as teasers (make data not show up)? Toward the bottom is some code for D5, not sure if it's any good but maybe it's worth a shot.

gearhead’s picture

Thank you WorldFallz.
I'll give that a shot.

Gear Head
www.musclecarsociety.com

gearhead’s picture

Which file do I put this code in to make it work?

Gear Head
www.musclecarsociety.com

WorldFallz’s picture

Into the template.php file for the theme you are using.

j9’s picture

for 6.x --- this works:

change your modules/search/search-result.tpl.php to read:

<dt class="title">
  <a href="<?php print $url; ?>"><?php print $title; ?></a>
</dt>
<dd>
<?php print $result['node']->teaser ?>
<!--  <?php if ($snippet) : ?>
    <p class="search-snippet"><?php print $snippet; ?></p>
  <?php endif; ?>
  <?php if ($info) : ?>
  <p class="search-info"><?php print $info; ?></p>
  <?php endif; ?>
-->
</dd>

if anyone knows this to break something, please let us know. thanks!

teh_catt’s picture

it's returning the link to the node or page but no teaser. Do you know if this works in conjunction with the Contemplate module?