Skip Navigation

[Resolved] Separate Shortcode for Map View than Lists

This support ticket is created 6 years, 7 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by donaldM-2 6 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#565370

I am trying to: achieve this look: hidden link but only using one view and not two like I am doing.

Link to a page where the issue can be seen: hidden link

Right now I am using two views for one post type. Map and List. The list view shortcode on the left and map view on right. When I search the list, the map doesn't update because they aren't the same view.

How do I use ONE view but have a shortcode to output the map and a shortcode to output the list.

TIA.

#565444

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - I see you are using two some visual editor and using that you have created two columns and you are displaying post list in left column and map in right column. Hense, due to its GUI we can not merge the two views into one but I can give you the solution that on when user will click on post title displayed on left column with post list view, it will display the associated map marker on right column.

To do that, I have added the following code to your map which displays post links on the left column.

<p class="vendor_title"><a href="javascript:void(0);" class="js-wpv-addon-maps-focus-map js-toolset-maps-open-infowindow-map-vendor-marker-marker-[wpv-post-id]" data-map="vendor" data-marker="marker-[wpv-post-id]">[wpv-post-title]</a></p>

Now, when you click on left column post link it will open the associated map marker pop-up.

#565529

I really appreciate that as it solves an issue! I have no problem using one view, I would just need to know how to separate the map and list into two shortcodes.

#565531

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

But the GUI will change, is that OK if we display map first and below the map post list?

#565532

no....unfortunately that look won't work. I guess we won't be able to separate the two elements? No worries.

Do you have a magic snippet that shows the markers in the search results on the map when a user searches?

#565534

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

No, there is no such snippet available.

Also, as your original issue is resolved, as per our support policy we entertain only one question per ticket. This will help other users searching on the forum. Thank you for understanding and have a great day 🙂

#565536

No worries! Thanks!

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