ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

ccv6 Pagintor does not seem to preserve search text beween pages

russelln 26 Apr, 2017
Hi,
really basic page here (just testing so far) and have the search text working fine. Added a paginator and found that when I click to the next page the search text isn't preserved, so the query changes.

New to this so may just be missing something.

Regards,
Russell
russelln 26 Apr, 2017
Just thought I'd add workaround, I added javascript in a domready to preserve the keywords between pages. Just wanted to check if this should be happening by default?

function insertParam(url, key, value) {
        key = escape(key); value = escape(value);

        var kvp = url.split('&');
        if (kvp == '') {
            url = '?' + key + '=' + value;
        }
        else {

            var i = kvp.length; var x; while (i--) {
                x = kvp[i].split('=');

                if (x[0] == key) {
                    x[1] = value;
                    kvp[i] = x.join('=');
                    break;
                }
            }

            if (i < 0) { kvp[kvp.length] = [key, value].join('='); }

            url = kvp.join('&');
        }
      return( url );
    }

<?php if ( isset($this->data['keywords']) ) { ?>
  jQuery('.pagination a').each( function() { jQuery(this).attr('href', insertParam( jQuery(this).attr('href'), 'keywords', '<?php echo $this->data["keywords"];?>') ) });
<?php } ?>
simelas 01 Sep, 2018
Hi Russell,

another alternate way using CCV6 build in functions: Keepsearchterm in thesearchwidget field when moving from page to page withpaginator

:-)
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com