Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
Hello,

I have a question about the highlighting of the searched words in the search results.
Currently the highlighting is done through the <b> tag.

So when I want to have another style than bold I have to write in my CSS:
Code: Select all
.search_result b {
    font-weight:        normal;
    background:         rgb(255,255,0);
}

Unfortunately the ellipsis in the k_search_excerpt variable are also styled with the <b> tag, so they get also the changed styling from my CSS.
Therefore my question: Is it possible to use another tag for the highlighting so that the ellipsis are not affected?
Umm..unfortunately I don't that would be possible. Currently the markup is hardcoded to add the <b> tags to the results, including the ellipses.
I'm not entirely sure if that works as I haven't played with search yet, but if the ellipses are always appended to the k_search_excerpts you could wrap a div around them and use the css selector :last-child to style them different.

Here's what I'm thinking:
Code: Select all
<div class="search_excerpt">
    <cms:show k_search_excerpt />
</div>

Code: Select all
.search_excerpt b:last-child { ... }


This would style all the last b tags in your excerpts differently. Just a wild guess, though.
Perhaps it is possible in the next release of Couch to use another tag for the markup of the searched words than for the ellipsis?
In HTML5 there is a <mark> tag to highlight text (only Safari does not support this tag).
Or a <span class="k_searched_word"> or similar?
Hi Nikos,

We'll certainly do that in the next version.
Could you kindly add that to our 'Feature requests' section please?
Added to 'Feature requests'.

I'm looking forward to the next version.
Is there already a timeline scheduled?
Hopefully within this month :)
7 posts Page 1 of 1