Search results and focus to hit in topic

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
bunnycat
Propeller Head
Posts: 70
Joined: Tue Nov 03, 2015 6:44 am

Search results and focus to hit in topic

Post by bunnycat »

Is there a way to ensure that a search result navigates/focuses to the first search hit in the topic?

Search highlighting worked as expected; I've added it into my stylesheets for my TopNav.
If the hit was inside a dropdown, it expanded the dropdown (which is fine), but didn't provide focus right to it.

Stakeholders were complaining that a search result hit didn't navigate them right in and focus on the hit. "It didn't work" (even though it actually did, it got them to the topic and highlighted instances of the term).

Can anything else be done to improve the particular behavior?

My help system is using the MadCap search engine. Due to where our site is hosted, we cannot use Google engine or Elastic Search.

Thanks!!

CAT
AlexFox
Sr. Propeller Head
Posts: 149
Joined: Thu Oct 19, 2017 1:56 am

Re: Search results and focus to hit in topic

Post by AlexFox »

The first search result on a page should be formatted as so:

Code: Select all

<span class="SearchHighlight SearchHighlight1">*MATCHING SEARCH TERM*</span>
Knowing this, you should be able to use some jQuery to scroll the browser to this element.
Post Reply