We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7527
    • 437 Posts
    distant_smile Reply #1, 13 years ago
    Hi all. I have an Ajax search (uncached) running on my site, it returns a link and two images from the resulting pages. The problem I have is that when I follow a result I get to the end page but instead of the address bar reading for example www.mysite.co.uk/fox.html it reads
    www.mysite.co.uk/fox.htmlhtml&searched=lime+hawkmoth&advsearch=allwords&highlight=ajaxSearch_highlight+ajaxSearch_highlight1+ajaxSearch_highlight2#comment-192289173


    How can I stop the Ajax search text appearing as part of the address. The reason I ask is that I run Disqus comments on my pages. I Ajax searched a page and left a comment. My user took a direct link to the page (that particular article was on the homepage) and left a comment. But you will never see both comments on the page as one is only visible on the Ajaxsearch result and the other on the direct link. I’m scratching my head trying to work this out so any help hugely appreciated! huh
      www.PawsForWildlife.co.uk
      www.Borntobrick.co.uk
      • 5811
      • 1,717 Posts

      First option: you remove the highlighting => &highlightResult=`0`

      or second option, you keep the highlighting, but you write a snippet to clean the url of the search result link and you use it in your search result template:

      <div class="[+as.resultClass+]">
      <a class="[+as.resultLinkClass+]" href="[[CleanMyUrl? &lnk=`[+as.resultLink+]`]]" title="[+as.longtitle+]">[+as.pagetitle+]</a>
        • 7527
        • 437 Posts
        distant_smile Reply #3, 13 years ago
        Thank you Coroico. I am still confused. Option 1 does not work, but what do I do with the code in option 2?
          www.PawsForWildlife.co.uk
          www.Borntobrick.co.uk
          • 5811
          • 1,717 Posts

          Option 1 does not work
          Not normal. By setting &highlightResult=`0` inside the ajaxSearch snippet call on your landing page, you shouldn’t get highlighting.

          Regarding the option 2, probably due to limitation of the parser, I can’t get the right result.
            • 7527
            • 437 Posts
            distant_smile Reply #5, 13 years ago
            Tried again today Coroico and......option 1 works a treat. You truly are an Ajax wizard, many thanks smiley
              www.PawsForWildlife.co.uk
              www.Borntobrick.co.uk