Top Navigation Search highlighting

This forum is for all Flare issues not related to any of the other categories.
Post Reply
DaleFranks
Jr. Propeller Head
Posts: 8
Joined: Fri Jun 12, 2015 12:56 pm

Top Navigation Search highlighting

Post by DaleFranks »

In the topics linked from search results, how do I get highlighting to work? I cannot figure this out. The link has the "highlight=Xxxxx" url parameter, I have set all 11 highlight styles in the main stylesheet.

The highlighting section of the doc says "In HTML5 Top Navigation, the search hits are transparent by default" then helpfully never mentions how to change this default behavior.

I'm a little frustrated, right now.
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Top Navigation Search highlighting

Post by NorthEast »

All you should have to do is set styles for span.SearchHighlight1, span.SearchHighlight2.
As described here: http://webhelp.madcapsoftware.com/flare ... h_Hits.htm

Have you checked that you added these styles to the right medium in the stylesheet, e.g. they're not in print by accident?
kerimucci
Propeller Head
Posts: 59
Joined: Thu Nov 02, 2017 3:38 am

Re: Top Navigation Search highlighting

Post by kerimucci »

I am using the Top Nav skin to produce HTML5 output. I have added a span.SearchHighlight class to my CSS, where the font color is set to purple to make matched keywords stand out in the abstracts (as opposed to a background color). However, my output is still showing the keywords in black text. I have tried setting this both from the Stylesheet Editor and from the Internal Text Editor, and in the preview of the Stylesheet Editor, the text is purple.

Is there another setting I need to enable to get this working? I also can't get partial word searching to work, so maybe this is related.
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Top Navigation Search highlighting

Post by Nita Beck »

I’m pretty sure that the solution Dave pointed to is still the correct solution. You need to define the colors for span.SearchHighlightN where N is 1, 2, 3, etc. for the first search word, second search word, third search word, etc. I don’t think it’s sufficient to define span.SearchHighlight.

For Flare 2020 r2, this is covered here: https://help.madcapsoftware.com/flare20 ... h-Hits.htm
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
kerimucci
Propeller Head
Posts: 59
Joined: Thu Nov 02, 2017 3:38 am

Re: Top Navigation Search highlighting

Post by kerimucci »

Thanks, I defined span.SearchHighlight, and 1-10, and am getting the same result unfortunately.
kerimucci
Propeller Head
Posts: 59
Joined: Thu Nov 02, 2017 3:38 am

Re: Top Navigation Search highlighting

Post by kerimucci »

Ah, OK. Maybe I am looking for something else. I now see that my properties are being applied once I click a result and go to a topic page. This is good, but I was looking for something that will highlight the search term within the search results page. Right now the matched words just display bold, using the font color of the abstract. I'd like to vary just the color of the search term within the abstract on the search results page. Is this possible?
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Top Navigation Search highlighting

Post by NorthEast »

No, Flare doesn't support that.
Flare also just applies a bold tag on the search results page, so even if you tried some hacky CSS, you can't style the search terms separately.
Psider
Propellus Maximus
Posts: 815
Joined: Wed Jul 06, 2011 1:32 am

Re: Top Navigation Search highlighting

Post by Psider »

I think it might have changed, unless Madcap is doing something funky with their own help?

This search has a <span class="search-result-highlighr"> on the bolded terms.
https://help.madcapsoftware.com/flare20 ... q=variable
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Top Navigation Search highlighting

Post by NorthEast »

Psider wrote:I think it might have changed, unless Madcap is doing something funky with their own help?

This search has a <span class="search-result-highlighr"> on the bolded terms.
https://help.madcapsoftware.com/flare20 ... q=variable
It's different for MadCap's help because they don't use their own MadCap Search engine - they use Elasticsearch.

The same limitation applies to Elasticsearch too though; all the terms on the results page use the same span class, so you can't style them differently.
Psider
Propellus Maximus
Posts: 815
Joined: Wed Jul 06, 2011 1:32 am

Re: Top Navigation Search highlighting

Post by Psider »

Oh right. I read it as they just wanted to change it, not that they wanted different colours.

(When they first introduced the rainbow, I have to admit I turned it off immediately :p )
kerimucci
Propeller Head
Posts: 59
Joined: Thu Nov 02, 2017 3:38 am

Re: Top Navigation Search highlighting

Post by kerimucci »

Thanks for confirming, guys.
Corinna
Propeller Head
Posts: 17
Joined: Mon Mar 20, 2017 5:56 am

Re: Top Navigation Search highlighting

Post by Corinna »

Having had the same problem (with the MadCap online help being of only limited help), I might have found a not-so-hacky CSS solution.

I noticed that the only bold term on the search results page is the search term, indeed. Hence, it's possible to address that exact bold span in CSS as follows:

Code: Select all

div#searchPane._Skins_<your search results skin name>.mc-component b {background-color: <your color>;}
My example:

Code: Select all

div#searchPane._Skins_suchergebnisse.mc-component b {background-color: #0000ff;}
Since the search description (preview) text in div.description doesn't seem to carry over any formats from the original topic (at least by default), there seems to be no risk of highlighting any other bold text unintentionally.
You do not have the required permissions to view the files attached to this post.
Post Reply