We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29781
    • 25 Posts
    Hello all,

    i am using [+as.resultNumber+] in the result.tpl.html to number the search-results. The problem here is that the result-numbers start new at 1 on each result-page i.e. with ten results per page I have number 1 for the first result also on page 2 and 3 instead of 21 and 31.
    Is this a problem of my type of using the placeholder or is there a bug in AS? Any advice to get the right numbers is welcome.
      • 5340
      • 1,624 Posts
      I think you might have a cache problem. Try uncaching the page
        • 29781
        • 25 Posts
        The page is uncached and the AS-call is also uncached. should not be the reason.
          • 4172
          • 5,888 Posts
          perhaps you can fix this when you change this lines in assets/snippets/ajaxSearch/classes/ajaxSearchOutput.class.inc.php:

          =>
          $listResults = $this->_displayListResults($site, $subsite, $display, $nbrs, $searchResults, $found);

          to:
          $listResults = $this->_displayListResults($site, $subsite, $display, $nbrs, $searchResults, $found, $offset);


          =>
          function _displayListResults($site, $subsite, $display, $nbrs, $searchResults, & $found) {

          to:
          function _displayListResults($site, $subsite, $display, $nbrs, $searchResults, & $found, $offset) {


          =>
          $this->_setResultNumber($this->offset + $i + 1);

          to:
          $this->_setResultNumber($offset + $i + 1);


            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 29781
            • 25 Posts
            Hi Bruno,

            I tested your suggested version and it works like expected i.e. it works smiley. Is this a bug or is there a sense in being like it is?
              • 5811
              • 1,717 Posts

              This bug has been registered as AJAXSEARCH-65

              I haven’t still the time to look at the solution proposed by Bruno, but I am pretty sure that this is the logical solution. Thanks Bruno.