Skip Navigation

[Closed] Map with all markers, plus pagination on an archive page

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.

This topic contains 4 replies, has 2 voices.

Last updated by Christopher Amirian 1 year, 10 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2563119

Tell us what you are trying to do?
On my CPT archive page, I want a block with a filter, followed by a map containing all the markers for my CPT, and a block underneath the map showing paginated text results.

Is there any documentation that you are following?
https://toolset.com/forums/topic/map-markers-and-pagination/

I have seen your response in a previous support query that such a display would require 2 views.

So, i have the following setup:
1) A view-archive,
2) A view - displaying all results, with the map marker shortcode
3) A view - displaying paginated results, with text fields such as title
4) A content template containing my map
5) A couple of content templates defining the loops for the views (2 and 3 mentioned above).

However, if I insert a content template into the loop of my view-archive, they don't render.

[wpv-layout-start]

[wpv-items-found]
[wpv-post-body view_template="map-with-legend-classic"]

<!-- wpv-loop-start -->
<wpv-loop>

[wpv-view name="loop-view-map-marker" limit="3"]
[wpv-view name="loop-view-house-for-paginated-results" limit="5"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-layout-end]

Note: I'm using the classic interface instead of the block interface because the block interface is too slow/crashes

What is the link to your site?
hidden link

#2563585

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

I might need to check the backend of your website, but judging the code you shared, Map has two sets of shortcodes. The Map itself and the markers shortcode.

the map should be out of any view loop. So you should not ad the map to any loop.

But the markers should go inside the views loop to get the items and proper address locations and with the ID of the map connected to the top map which is outside of the loop.

For more information:

https://toolset.com/documentation/legacy-features/maps-plugin/how-to-display-custom-search-results-on-a-map/

If you still need help, I'd appreciate it if you could give me the URL/User/Pass of your WordPress dashboard after you make sure that you have a backup of your website.
It is absolutely important that you give us a guarantee that you have a backup so if something happens you will have a point of restore.

Make sure you set the next reply as private.

#2563693

Thanks - I have followed those instructions. I can add a [wpv-map-render] shortcode with no problem - but I have my map with some custom formatting in a content template. If I add the [wpv-post-body] shortcode, nothing renders?

#2564701

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

Thank you. I wonder if you have access to the satging version of the website so I can do tests there?

If yes, would you please add the login information in the next reply?

If not, please give me the live website login and I will copy it to our server for further ivestigation.

Thanks.

#2566153

Christopher Amirian
Supporter

Languages: English (English )

Screenshot 2023-03-05 at 13.51.28.png

Thanks, yes that is correct, try to keep the Map code inside the view.

It seems to be working I checked this:

hidden link

You used this code:

[wpv-view name="view-all-map-markers"]
[wpv-view name="view-paginated-house-results"]

Which is a logical thing to do. I shared the screenshot of what I see.

Do you get any problems there? If the map inside that is the problem, try to add the customization inside the view itself rather than using content template.

The topic ‘[Closed] Map with all markers, plus pagination on an archive page’ is closed to new replies.