We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33002
    • 17 Posts
    Hi there!

    I’ve come across an interesting article about keyword-highlighting. I thought it might be a good idea to make a plugin off the sample code. And here it is (attached).
    As you can see, there is only a small number of search engines supported yet. Please feel free to post the code for additional ones.
    Maybe I’m going to add multilanguage support later. Don’t know how yet. I’m quite new to Modx-development.

    I’m not sure wether there are some security issues with the plugin (e.g. XSS). Perhaps someone can have a look at that?

    Any oppinions?
      ...whatever...
      • 33337
      • 3,975 Posts
      Zaigham (aka zi) Reply #2, 19 years ago
      cool concept. Thanks for sharing.

      I am sure you’ll get some feedback from other folks soon smiley.

      Good luck.
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 7231
        • 4,205 Posts
        Looks cool. What would make this the cats meow would be to allow highlighting only in a specified <div> or #id, this would keep it from highlighting navigation items or other non content elements. Also it would be cool to integrate with the MODx search snippets.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 33002
          • 17 Posts
          There’s already a plugin which integrates with AjaxSearch: Search_Highlight
          Unfortunately I could not find it in the ressources on the main page. Maybe it’s part of the main package of MODx. Perhaps I could merge both plugins.

          SEHighlight works exactly like e.g. the highlighting on Googles cache pages. Its not limited to certain elements. I know what you mean but I think that this is the better solution. When I look for certain keywords on google, I want to see where they are on the resulting pages. Even if they are not in the content...it helps deciding wether the page is worth reading or not.


            ...whatever...
            • 7455
            • 2,204 Posts
            I also would like an option to select a div / container now the highlicht messes up my menu I do not like that.

            Dimmy
              follow me on twitter: @dimmy01
              • 8883
              • 59 Posts
              I implemented this plugin.
              I also use GoogleMaps (Snippet) on my page

              Unfortunately the GoogleMap is not visible, when using SEHighlight.

              And is it possible to remove the Note on top of the page? Just highlight the words.

              [i]Edit: I just removed code:
              $notice = str_replace('###SEARCHENGINE###',$search_engine,NOTICE);
              			$notice = str_replace('###KEYWORDS###',substr($keywords_list, 0, -2),$notice);

              [/i]

              I think the note distracts the user, coming from search enginges.
              But in fact it’s a nice plugin!
              thx