We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11807
    • 21 Posts
    ...how i can show longtitle instead pagetitle in the result page of ajaxsearch?
    Is it possible?

    I’ve try to replace pagetitle with longtitle in the snippet, but don’t show nothing:

    $SearchForm.=’<a class="ajaxSearch_resultLink" href="[~’.$SearchFormsrc[’id’].’~]" title="’ . $SearchFormsrc[’pagetitle’] . ’">’ . $SearchFormsrc[’longtitle’] . "</a>".$newline;

    Thanks.

    Harl
      • 32646
      • 87 Posts
      I’m glad you mentioned this, because it reminded me that I wanted to do that, too. I am assuming you are using ajaxSearch 1.7.

      You need to go into assets/snippets/ajaxSearch/includes and change line 27 from:

      <a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.pagetitle+]</a>


      to

      <a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.longtitle+]</a>


      My only problem was that I found a number of documents that didn’t have longtitles which means they showed as blanks.
        Just learning the ropes.
        • 19605
        • 11 Posts
        Quote from: wordcooper at Jan 31, 2008, 03:04 PM

        My only problem was that I found a number of documents that didn’t have longtitles which means they showed as blanks.
        You could try adding an "if" statement to check if longtitle is present and put it in only then.