I would like to customize the search results. We’ve currently got three areas: Knowledge Books, Online Training and Training Videos. Currently, the results from all three area’s are intermixed in the results. I’d like to have the results grouped by area, and then sorted by relevance.
The current code in search.tpl.php looks like this:<?php foreach($this->splugin('Search','search', $this->get_q, $this->get_area) AS $result): ?>
<td> <a href="index.php<?php echo $result['link'] ?>"><?php echo $result['title'] ?></a> <br /> <?php echo $result['desc'] ?> </td> <td class="score"> <?php echo $result['score'] ?> </td
I know very little about PHP, although I am proficient in a number of other languages, so if I’m off base in some of my assumptions please feel free to correct me.
The call to splugin(‘Search’,… I believe is calling Search.php, which has been encoded or otherwise obfuscated. Is this call documented anywhere? What exactly is returned in the $result object? If the area is returned then I could probably figure out the PHP to do what I want (i.e. just process each area seperately).
Note that the <td class=“score” closing element is missing the end tag (>) - probably an issue with the provided templates.