Hi,
Im using Views 2.7 in Drupal 6. I've created a view with a search filter which users can change (the filter is exposed). Now, when a user searches, the results are filtered accordingly. This all works fine. But usually the results are quite much and therefore I'd like to highlight the search term in the resulted text, just like the Drupal search engine. E.g when I search for the word "case", then all the words that are/or contain "case" are highlighted.
How can I do this? Someone suggested a str_replace while looping through the results array or variable and then replacing the keyword with $keyword or something like that. But I'm unable to find where or how to do this.
I hope you can help!
Comments
Any Luck
Did you ever find a way to do this?
search_excerpt()
http://api.drupal.org/api/function/search_excerpt/6
In a node template file you can put your body and comments through this function.
Why doesnt views do this by
Why doesnt views do this by default when using search?
Adriadrop Drupal development
Anyone who already solved
Im also looking for solution to this problem, I think this should always be included in the search function.