Please login or register.

Login with username, password and session length
Advanced search  


Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: Highlight searched terms  (Read 2640 times)


  • Newbie
  • *
  • Karma: 0
  • Posts: 4
Highlight searched terms
« on: November 10, 2006, 02:44:27 am »

I'm only on day #1 of my new sNews installation and am already loving the flexibility and power of this beautiful little piece of coding... kudos to the developers!  :D

I did a quick search of the forums but did not see anything related to the following question: Is there any modification available or code that could be added to sNews that would HIGHLIGHT the terms found as a result of the SEARCH function within the site? I'm thinking of a different color font, or perhaps a bold or italicized font.

So, for example, if someone where to search on the term "DIFFERENT", the search results would continue to link to the post (or posts) containing that term, but the term being highlighted in a different color for ease of identification. Something like this:

          "...I'm thinking of a different color font..."

I'm relatively new to CSS and PHP and all the other fun stuff under the hood, so I'll toss this one out to those more experienced and knowledgeable than me...

Any thoughts or ideas?


  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • - rédacteur Web
Re: Highlight searched terms
« Reply #1 on: March 13, 2010, 03:06:44 pm »

Hi dudes
I'm working on HTML5 and SEO and have to see if there's a way to improve ranking on search terms using the mark tag (a new tag, better than strong for emphasis as I can see on my tests).

So the idea is to embrace the term searched with this tag.
Like this:

Code: [Select]
<p>L'<mark>inspecteur</mark> Sven is seeking for a clue.</p>
Bots gonna like it. Visitors too.
Forget it.
JS can make it:
« Last Edit: March 14, 2010, 11:56:46 am by Sven »