Skip Navigation

[Resolved] Show all entries on map and in filter.

This support ticket is created 3 years 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)

Author
Posts
#1986811

Hi Waqar,

We have a map with all the entries included in a view.
Because we don't want to display all entries at once we use pagination and show 24 entries per page.

We would like to display all the entries both on the map and in the filter.

At the moment we only have the option to either use all entries without pagination or use pagination with e.g. 24 entries - but then not all entries are shown on the map and in the filter, but only 24.

We would be open to let's say show the first 24 entries below the map with infinite scrolling (if that doesn't effect page load and speed).

Here's the page: hidden link

#1988233
block-navigation.png
available-options.png

We would like to display all the entries both on the map and in the filter.
You can turn off the option "Show only filter options that would produce results" in the View settings to include options from all posts (rather than options for only the results in the current page) in the filters. First, select the top-level View block in the block editor. You can use the Block Navigation menu to quickly select the top-level View block. Then open the Custom Search panel and turn off the option "Show only filter options that would produce results" - see available-options.png and block-navigation.png

I'm not aware of an easy way to paginate listings in the View results but show all listings in the map markers, when using only one View. I think you would need two Views to accomplish this - one View with pagination that displays the results listings, and another View without pagination that is used to display markers on a map. The loop of this second View would be empty, because it does not display the results listings.

If you want to update the markers based on the filter selections, then it gets more complicated because the two Views are not inherently linked like that. You would not be able to use AJAX updates in this case, you would have to reload the page so both Views can be updated by the filters.

Let me get your feedback so far before we get into the technical implementation here.

#1988937

Turn off the option "Show only filter options that would produce results".

THIS IS NOT A VALUABLE OPTION AS WE ONLY WANT TO SHOW THE USER FILTER OPTIONS FOR WHICH THERE IS DATA AVAILABLE.

I think you would need two Views to accomplish this - one View with pagination that displays the results listings, and another View without pagination that is used to display markers on a map.

If you want to update the markers based on the filter selections, then it gets more complicated because the two Views are not inherently linked like that. You would not be able to use AJAX updates in this case, you would have to reload the page so both Views can be updated by the filters.

THIS IS NOT A VALUABLE WORDAROUND.

WHILE WAITING FOR A PROPER SOLUTION PLEASE ADVISE HOW WE CAN SHOW ALL PROPERTIES ON A SINGLE PAGE WITH INFINITE SCROLL.

#1989151

Okay I'll see what we can do. Let me be sure I understand how you expect the map to work. You mentioned you would like to display all the entries on the map as markers. After filtering using the custom search filters, do you want to update the map so only those filtered results are displayed, or do you want to continue displaying all entries regardless of the filter selections?

#1989167

After filtering using the custom search filters we want to update the map so only the filtered results are displayed.

While you are making the investigation, HOW CAN WE SHOW ALL PROPERTIES ON A SINGLE PAGE WITH INFINITE SCROLL?

#1989625
Screen Shot 2021-03-16 at 4.52.29 PM.png

While you are making the investigation, HOW CAN WE SHOW ALL PROPERTIES ON A SINGLE PAGE WITH INFINITE SCROLL?
- Create a View of Properties posts with no filters.
- Select the top-level View block in the block editor.
- In the Pagination panel, choose "Pagination enabled with manual transition and AJAX" and choose Transition Effect: "Infinite Scrolling" (see the screenshot).
- Choose the number of results to display per scrolling group in "Items Per Page".
- In the "Limit and Offset" section, choose limit "No limit" and items to skip "None".
- In the View's loop block, design the display for each result by inserting various blocks as desired.

#1989665

Also this is not a valuable solution.
The items are all shown on the map but not in the filter.
Please refer this threat to Waqar.

#1989669

Sure, I will transfer to Waqar. Have a nice day.

#1990863

Waqar
Supporter

Languages: English (English )

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

Hi,

Thank you for waiting, while I performed some tests on my website.

My results are a bit different from what you've shared in the first message in this thread:

"At the moment we only have the option to either use all entries without pagination or use pagination with e.g. 24 entries - but then not all entries are shown on the map and in the filter, but only 24."

When using the pagination, the number of markers shown on the map is dependant on the results which are shown through the view's current page, but it doesn't affect the options available in the search filters. The search filters would still show all options which can produce some results, irrespective of the current page.

If you're experiencing different behavior on your website, please share the link to the example page and the information about the missing search filter options.

As for showing all map markers at once, I'm afraid, I couldn't come up with a different workaround than what Christian has already suggested. You'll have to use one view without pagination to show all map markers and the other view with pagination to show the results with pagination.

regards,
Waqar

#1993501

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I just wanted to confirm that if you want paginated results for the list of posts but want to show all of the markers on the map then you must use 2 Views for this.

When you use pagination the query on the first page will request the first 24 posts from the database only. If the map uses the same query to display markers then it can only display markers for those same 24 posts, it cannot magically know what the other posts arre which the database didn't provide in the query results. It needs a separate query without pagination to get all of the posts which should be displayed as markers.

The challenge is that both Views—one for the paginated list of posts, one for the map markers—will need to respond to the same set of search filter controls, you don't want two sets of filter controls that both need to be updated.

If that makes sense and you want to proceed with a solution on that basis, Waqar can guide you through the steps.

#1997645

My issue is resolved now.

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