Differentiating Search Results

This forum is for all Flare issues not related to any of the other categories.
Post Reply
Don Barwick
Propeller Head
Posts: 11
Joined: Wed Feb 03, 2016 5:22 am
Location: England, UK

Differentiating Search Results

Post by Don Barwick »

Does anyone know if it's possible to differentiate search results (in HTML5 output)? I would like to be able to visually distinguish, for example, a release note from a help topic, or a technical topic from an end-user one. I'd like to be able to display an icon (or possibly a short piece of text) next to the result to indicate which type of result it is.

In addition to this, I'd also like certain search results to open in a new window (with most results opening in the main window). Any ideas?

Thanks,
Don
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Differentiating Search Results

Post by NorthEast »

There isn't anything built-in to Flare which would do that.

You can use a search filter, which allows you to filter the results according to concept markers that you include in topics.
So you can filter the list, but you can't format the list to display items differently according to the filter/concept category (or any other tag/marker).


You can do some limited formatting of the search results using CSS, based on attributes in the links themselves.

For example, say you're producing HTML5 using a Top Nav skin, and you have release notes in a folder called "Release" and technical topics in a folder called "Technical".
In your CSS, you could add something like this:

Code: Select all

ul#resultList a[href*="Release"]:after
{
    content: " (Release notes)";
}

ul#resultList a[href*="Technical"]:after
{
    content: " (Technical doc)";
}
The CSS will add content after any link in the search results (#resultList), where the link href attribute (a[href*=""]) contains the folder name in its text (which is case-sensitive).

This example will add text content, but that can also be an image, e.g. content: url('folder/image.png');
Don Barwick
Propeller Head
Posts: 11
Joined: Wed Feb 03, 2016 5:22 am
Location: England, UK

Re: Differentiating Search Results

Post by Don Barwick »

Thanks, Dave. I like the idea of using CSS formatting based on the links - I hadn't thought of that. I'll give it a go.
Post Reply