0

I have a search results page using Low Search that has two tabs on it for two different sets of search results. I think that the fact that this uses Low Search is mostly irrelevant for this question since I'd have this same issue if I was just using two channel entries tags on the page.

One tab is pulling in local results using geocoded distance parameters. The other tab is pulling in all results, ignoring the distance parameters.

This is working well, but the problem comes in when we have multiple pages. For example, sometimes there are multiple pages of results in the first tab and only one page of results in the first tab. So if the user goes to the second tab and clicks through to the 4th page, then clicks back to the first tab they see no results because it's using the P40 segment in the URL to look for the 4th page of results but not finding a 4th page for the results in that tab. Here's an example of the full search URL:

https://www.domain.org/search-results/P40?keywords=thiskeyword&distance:radius=100&location=Austin&distance:from=32.7766642|-96.79698789999998

Can anyone think of a workaround for this? I haven't been able to figure out a good solution to have pagination only apply to one specific results tag or channel entries tag on the page.

1

You need to use Low Search with an Ajax functionality. You can individualize each search tab (separate them programmatically with different DOM id's and jQuery calls) and hit the ACTion URL of the add-on, and update the DOM asynchronously.

https://gist.github.com/low/4632695

Once you get your

data

variable back, just use jQuery to remove and recreate your result tab results. You will lose out a little though; web crawlers won't be able to crawl the entirety of your search results, but I figure you didn't really have that going on anyways unless you also have the option of opening the two searches on two different pages (open each one individually with crawlable URLs). In which case, you're kinda of covered there.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.