All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Highlight keyword in title

leeaston 6 Feb 2013 15:46 question, complete

Keyword in title is not being highlighted in results. Is there a setting I've missed?

a href="{comment_url_title_auto_path}">{title}</a

Thanks!

Replies

  1. Low 7 Feb 2013 07:47

    Currently it highlights words in the excerpt only.

  2. leeaston 7 Feb 2013 09:10

    Is it something you'll be implementing? It seems like a natural addition given keywords are highlighted in the excerpt?

    Best wishes
    Lee

  3. Low 7 Feb 2013 09:31

    Point is, people might not always use {title} as the title, but a custom field. Then you'd want to highlight keywords in any field, which (formatting wise) is a bit of a nightmare.

    You can add title highlighting by opening up ext.low_search.php (v2.2.0), then go to line #415, add a new line below it and put this there:

    $row['title'] = $this->_highlight_keywords($params, $row['title'], $tag);

  4. leeaston 7 Feb 2013 10:31

    Thanks, that worked - wow your coding is neat!

    I get what you say about people might not always use {title} as the title, but a custom field. But having it as an option, a least for {title} would I think be useful for a lot of folks. Having search terms highlighted in the titles of a results page is pretty much expected - Google and friends do it, as does Super Search.

    Any chance of it getting in a release - save me hacking every update?

    All the best
    Lee

  5. Low 7 Feb 2013 10:33

    Will definitely consider it.