Skip Navigation

[Resolved] Is it possible to show all entries on map, but the entries below are paginated?

This support ticket is created 4 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by michaelM-30 4 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#1281699

I have a map with all my entries (within a view).
Because I don't want to display all entries at once I use pagination (with Ajax).

The problem is - with the new caching in Google maps, I would like to display ALL my entries in the map, but only let's say the first 25 entries of my posts below the map - with infinite scrolling.

At the moment I only have the option to either use all entries (without pagination) OR use pagination with e.g. 50 entries - but then I cannot see all entries in the map, only 50...

best regards
Michael

#1281727

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Michael,

It looks like that our chat was disconnected, so I've moved this question to a regular support ticket.

Your observation is correct and when the number of results shown through a view at once, is restricted through pagination, the same number of corresponding map markers will also show on the map.

To show all the map markers at once, you can duplicate your existing view and keep the pagination settings in the original one, but remove the code for the map and the markers from it.

The new duplicated view can be then be set to show all results without pagination and you can output the map and its marker through this view, on the top of the original one.
( of course, you'll also remove all other output from this duplicate view so that it is only used for the map and the markers )

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1281741

Hi Waqar, thanks for the help.
But If i do it like this, I loose the possibility to filter based on custom post types.

I would have 2 filterings - one for the map and one for the posts below.

Is it possible to "restrict" the output of the posts below the map with a custom pagination regardless of the "no pagination" of the map above?

#1281855

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Michael,

Thanks for writing back.

Can you please share the link to the page where this view can be seen, along with the temporary admin login details?

I'll be in a better position to suggest a workaround, after seeing how that view is set up.

Note: Your next reply will be private and though no changes will be made on your website, please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1283147

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Michael,

Thank you for waiting.

I wasn't able to login to your website's admin area since the password didn't work but I performed some tests and research on my own website.

The closest possible solution to what you're planning is the one that I have already suggested in my reply earlier.
( ref: https://toolset.com/forums/topic/is-it-possible-to-show-all-entries-on-map-but-the-entries-below-are-paginated/#post-1281727 )

Any search filters that you have added to the view will still work, but you'll have to take care of the following items:

1. Please make sure that the "Query Filter" settings remain exactly the same in the original view and the duplicate view.

2. You'll also need to remove the HTML content for the search filter fields and pagination from the "Search and Pagination" section of the duplicate view.
( screenshot: hidden link )

3. The duplicate view should only output map and the markers and the original view should output the search filter fields and the rest of the content.

4. To ensure that the search filters work for both views at the same time, you'll need to change the pagination and search settings to update the results with a page reload and not through AJAX.
( screenshot: hidden link )

Please let me know how it goes and if you face any difficulty making this setup work, please share the updated admin access details.
( your next reply will be private )

regards,
Waqar

#1284071

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Michael,

Thanks for the update and glad that it works.

I was also able to access the admin area, using the updated password.

> Although for my users it will be a little different to the normal behavior of the website.
> Everywhere else the filtering is working with AJAX and without a Filter Button.
> This will be the only page where after choosing the filter dropdown, the search button has to be klicked.

- I'm afraid, with the available features, this is the closest workaround that works, with the downside of losing the AJAX. But if you feel that this feature of independent map and pagination control can prove useful for other users too, you're welcome to submit a feature request at:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

The next possible workaround would be to use a single view for both map and rest of the content without the built-in pagination. As a result, all posts will be returned each time, which can be shown in smaller chunks/pagination, added through a custom script, but of course, this will need a fair amount of customization.

> Also after clicking the button, the reloaded page jumps to the top - which is irritating.

- To automatically scroll to a specific section of the page, when the page reloads, you can add some custom script.

Example: https://stackoverflow.com/a/32887164

> Another question, although we "only" have 3k entries, the map still needs very long time to display.
> And yes I have converted the map cache when installing the latest version of toolset-maps.
> Is there something that can be done to get a faster querry, or loading the google maps?

- In my tests, the page ( hidden link ) loads fairly quickly, considering that it has to process a large amount of data twice (since there are two views now) and then plot them on the map (with markers from different custom fields).

Also, since there is "Infinite Scrolling" enabled too with AJAX pagination update, it means that page also preloads images from the results which are not showing yet, but are on next page.

All the above factors contribute to the overall page and map's loading time.

> And one more thing, I did the querry with the maps, because the filtering has to be on top of the map, as it also filters the map. (at least it is so, on our site).

- That is fine and it doesn't matter if the query's filtering fields are present in one view or the other. The idea is to present the visitors with a search form that can pass on the values to the URL parameter, for the query filter to shortlist the results.

regards,
Waqar

#1284087

Hi Waqar,
I understand - thanks for your help!

#1284089

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.