Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Add search results pagination #5

Open
arnaudbroes opened this issue Apr 15, 2016 · 6 comments
Open

Add search results pagination #5

arnaudbroes opened this issue Apr 15, 2016 · 6 comments

Comments

@arnaudbroes
Copy link
Contributor

Add search results pagination

@wpsmort
Copy link

wpsmort commented Jun 15, 2016

I believe there should be code for this in SimpleMap v2.5.

@michaeltorbert michaeltorbert removed their assignment Mar 29, 2017
EkoJR added a commit to EkoJR/simplemap that referenced this issue Apr 3, 2017
EkoJR added a commit to EkoJR/simplemap that referenced this issue Apr 3, 2017
@wpsmort wpsmort self-assigned this Apr 3, 2017
@EkoJR
Copy link
Contributor

EkoJR commented Apr 3, 2017

I also added new style classes to allow users more control over the customization.

  • location_search_prev_page - Used with the Prev link
  • location_search_next_page - Used with the Next link
  • location_search_page_num - Used with the Page Number Text

Thinking about it now, may need to cancel PR #229 to add additions to Light & Dark CSS files. Even if there is no styling, would it be best to make those additions to .css files?

EkoJR added a commit to EkoJR/simplemap that referenced this issue Apr 4, 2017
EkoJR added a commit to EkoJR/simplemap that referenced this issue Apr 4, 2017
@wpsmort
Copy link

wpsmort commented Apr 4, 2017

@EkoJR We should use the standard classes for CSS which can be found here - https://codex.wordpress.org/Pagination. You should be able to test with Twenty Sixteen or Twenty Seventeen themes and the styling should be the same as the rest of the pagination in the theme.

I tested PR #231 but the Next and Prev links didn't do anything and there were no JS errors in the browser console.

@wpsmort wpsmort removed their assignment Apr 4, 2017
@wpsmort wpsmort added this to the 2.6 milestone Apr 4, 2017
EkoJR added a commit to EkoJR/simplemap that referenced this issue Apr 5, 2017
EkoJR added a commit to EkoJR/simplemap that referenced this issue Apr 5, 2017
EkoJR added a commit to EkoJR/simplemap that referenced this issue Apr 5, 2017
@wpsmort wpsmort self-assigned this Apr 6, 2017
@wpsmort
Copy link

wpsmort commented Apr 6, 2017

@EkoJR I have tested this and found that when you click on Prev or Next nothing happens
Also, the number of locations displayed per page should be taken from the Number of Results to Display in SimpleMap > General Options. So if I set that option to No Limit or anything higher than the number of locations I have then no pagination should be displayed.

For example, if I have 5 locations and I set Number of Results to Display to 10 then there should be no pagination because there's only 5 locations which is less than the 10 set in Number of Results to Display.

@wpsmort wpsmort removed their assignment Apr 6, 2017
EkoJR added a commit to EkoJR/simplemap that referenced this issue Apr 7, 2017
EkoJR added a commit to EkoJR/simplemap that referenced this issue Apr 7, 2017
@wpsmort
Copy link

wpsmort commented Apr 17, 2017

@EkoJR I tested this and the pagination works fine now. However, the search no longer outputs only matching locations, instead it seems to output locations outside of the search criteria. For example, if I have 6 locations within 10 miles of ZIP code 27540 and I search based on that criteria, the paginated search results actually outputs 10 locations which include locations in other States and other countries.

@wpsmort
Copy link

wpsmort commented May 15, 2017

This is tested and is working fine. This is ready for a code review. The branch with the latest commits is https://github.com/EkoJr/simplemap/tree/issue-5

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants