I have a search module that grabs locations based on coordinates and estimates distances. I've decided to extend then channel class so I can take advantage of the entries method to display search results. In my method, I use an sql query to find the entry_ids and estimated distance. I then have the following:
public function search_results() {
...
$entry_ids = '4|24|265|23';
$distances = array(
1.023536,
1.254824,
3.000325,
4.923142
);
ee()->TMPL->tagparams['entry_id'] = $search_ids;
return parent::entries();
}
This works great with the following code in my template, with one problem:
{exp:module:results}
<li>
<span>{distance}</span>
<h4><a href="/location/{url_title}">{title}</a></h4>
<div>{my_custom_field}</div>
</li>
{/exp:module:results}
The "distance" is not a channel field, but that calculated value. Any suggestions on how I can inject that into the parsing per row?