All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Filtering Results When Using Pagination

Jemes 15 Jul 2014 16:23 question, complete

When using filtering without pagination being used my results are working well and using pagination works with the results.

My issue is when I use the pagination and then want to filter by another category my results always return empty, even though I know there are results as they display when not using pagination.

http://pastie.org/private/duzc1cf3kok...

URL Without Pagination (Working):
all-products?orderby_sort=title|asc&category:type=107

URL With Pagination:
all-products/P100?orderby_sort=title|asc&category:type=107

Replies

  1. Low 15 Jul 2014 18:38

    I'm not sure I follow completely. Can you try and elaborate, including examples of what you're trying to achieve and what it is you're actually getting?

    Also, please mention your LS, EE and PHP versions.

  2. Jemes 15 Jul 2014 19:46

    Basically what happens is that when I use the paginated link page 2, 3 etc the urls update with the P100 in the url and this all works as expected.

    Then when I click one of the various filters I have on the page the URL updates with the category but no results are display but I know there are results for that category. If I remove the P100 from the URL the result are displayed correctly.

    I wasn't sure if by filtering the results on a paginated page I was filtering just that page of paginated results rather than the full set of results?

    I hope that is slightly clearer.

    EE: 2.8.1
    LS: 3.1.4

  3. Low 16 Jul 2014 07:15

    Are you using the Filters tag to generate URLs? If so, have you defined a result_page="" parameter on the opening Filters tag?

  4. Jemes 16 Jul 2014 08:02

    I'm using the filter tag to generate the urls.
    {low_search:url toggle:category:type='{cat_id}'}

    I have the results _page parameter also.
    {exp:low_search:filters result_page="{current_url}"}

    I think I need the filter url to be aware that the current page is using pagination and when clicked reset the search using the the current search parameters excluding the pagination segment in the url?

  5. Low 16 Jul 2014 08:04

    The {current_url} will include the pagination segment. If you change that to something like result_page="{segment_1}/{segment_2}", making sure the pagination segment is not part of the result_page param.

  6. Jemes 16 Jul 2014 10:29

    That works perfectly thank you.