views:

53

answers:

1

On my drupal search results page link directly to the comments of the post, in addition to just the post itself. Looking at the search.module file the relevant code seems to be.

$output = ' <dt class="title"><a href="'. check_url($item['link']) .'">'. check_plain($item['title']) .'</a></dt>';

The issue is I can't figure out where on earth $item['link'] is coming from, or how to get the link variable for the comments in there. Any help you could provide would be great.

A: 

You want to link to the comments in addition to linking directly to the node itself? That's not so hard...

For the same page you need to change the output to something like:

$output = ' <dt class="title"><a href="'. check_url($item['link']) .'">'. check_plain($item['title']) .'</a></dt><dd><a href="'. check_url($item['link']) .'#comments">'. check_plain($item['title']) .'</a></dd>;

Of course, you'll want to mess around with the theming a little.

John Fiala