I have a very crude implementation of highlighting search terms on the page. It took a quick hack of the FlexSearchForm:
added the &searched=’.$searchString.’ to line 343
$resultPageLinks .= '<a href="[~' . $modx->documentObject['id'] . '~]&searched='.$searchString.'&FSF_offset=' . $nrp . '&FSF_search=' . urlencode($searchString) . '">' . $resultPageLinkNumber . '</a>';
and again to line 361
$SearchForm.='<a class="FSF_resultLink" href="[~'.$SearchFormsrc['id'].'~]&searched='.$searchString.'" title="' . $SearchFormsrc['pagetitle'] . '">' . $SearchFormsrc['pagetitle'] . "</a>".$newline;
and this plugin (tied to OnWebPagePrerender)
if(isset($_GET['searched'])) {
$searched = $_GET['searched'];
$content = $modx->documentOutput;
$new = str_replace($searched, '<span class="searchterm">'.$searched.'</span>', $content);
$modx->documentOutput = $new;
}
Style the .searchterm span in the CSS.
As I said, it’s very crude and only does one term and one color. But it’s a start!