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

Support archive

How can I highlight the keyword in a search result?

Eric 15 Jan 2012 02:01 question, complete

Like this https://structure.tenderapp.com/searc...

I tried using expression engine's first party addon called Hilight, http://expressionengine.com/downloads..., but when I wrapped the tags around {low_search_excerpt} it didn't do anything.

Any ideas?

Replies

  1. Low 15 Jan 2012 13:31

    Hi Eric,

    That plugin is only compatible with the native search module, I guess.

    Low Search itself doesn't do keyword highlighting, but you could probably use another add-on for that, like Low Replace. Something like this:

    {exp:low_replace find="{low_search_keywords}" replace="<strong>{low_search_keywords}</strong>"} 
    {low_search_excerpt}
    {/exp:low_replace}

    electriclabs 12 Jul 2012 16:37

    This answer was exactly what I was looking for. +1 for a FR for this to be added someday to LS :)

    Thanks,

    Rob

  2. Eric 15 Jan 2012 18:18

    That worked perfectly, thanks!

  3. theartofpeople 29 May 2013 00:34

    Hi there,

    I'm wondering if its possible to use Low Replace like this but with the native EE Search module.

    I'm using the following but it doesn't pick up the keywords:

    {exp:low_replace find="{exp:search:keywords}" replace="{exp:search:keywords}"}{title}{/exp:low_replace}

    Cheers :-)

  4. Low 29 May 2013 09:43

    If using parse="inward" on the low_replace tag doesn't work, then I'm afraid that's not possible. Another good reason to just use Low Search. :)