Skip Navigation

[Resolved] [wpv-post-title] in loop outputting page title instead of looped post title

This support ticket is created 2 years, 10 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 JoelK2744 2 years, 10 months ago.

Assisted by: Waqar.

Author
Posts
#2097209

Hello, I understand from Nigel that OpenStreetMaps isn't being added in the next release of Toolset as originally planned (https://toolset.com/forums/topic/1-6-beta/) so I'm trying to implement a custom solution.

I've built a view with blocks for the main output and then also added another legacy view on the same page for the map using shortcodes and the Leaflet Plugin. It's generally working fine but I've had to remove the Ajax refresh and do full page reload to get the filters to work together for both views - firstly, is it possible to do this with Ajax refresh on submit button? I'm guessing it might need some custom JS for the map view to recognise when the filter's changed on the main view? Ideally I would like to get it to work like it does on this page when the filters are changed - {link-removed} (this is using the inbuilt map block).

The other issue I'm having is with the map markers - [wpv-post-title] is outputting the page title where the view is located rather than the individual post titles for some reason. Everything else in the view loop is working fine (e.g. the coordinates and the post url etc), it's just the post title for some reason. I've also tried [wpv-post-title id='[wpv-post-id]'] but that doesn't work either.

You can see the views on this page - {link-removed} (as this is a development site I would appreciate it if this and the above url can remain hidden and not be recognisable from any screenshots etc you might include in any replies - many thanks).

Thanks,

Joel

#2097715

Waqar
Supporter

Languages: English (English )

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

Hi Joel,

Thank you for contacting us and I'd be happy to assist.

To better understand how the views and map work, I'll need to see how it is set up in the admin area.

Can you please share temporary admin login details in reply to this message? I'll be in a better position to assist you with these questions accordingly.

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

I've removed your website's domain information from your last message and won't mention any specific details publically.

regards,
Waqar

#2097721

Hi Waqar, sorry to be a pain but could you removed the urls completely as the rest of url is now visible to all users? Many thanks

Also, would it be possible to send me a sandbox link to replicate the issue - I've had this in the past from Toolset support, something like hidden link - this was really helpful.

Thanks

#2099205

Hi Waqar,

Any joy with the above?

Thanks

#2099261

Waqar
Supporter

Languages: English (English )

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

I apologize for the delay in getting back, as we had unusually busy queue.

I've created a sandbox website for you and will share the access details in the next private reply.

The URLs that you've shared have been removed too.

#2099365

Fantastic, thanks Waqar. No problem about the delay, it actually gave me time to work out how to solve the post title issue, so it's just the Ajax refresh issue that's a problem. I've duplicated the view on the homepage of the sandbox site, I've set it to full page refresh for both views so you can see it works in this setting (I've also kept the filters above the map for convenience).

What I would like it to do is work like a standard Toolset Google map when 'Ajax refresh on submit' is chosen for the main (non-map) view, where the map also changes based on the filter selected. Could you help with this?

The other issue I've noticed when Ajax refresh is selected for both views is that the map fails to load when the reset button is pressed, can see why that's happening?

Hope that all makes sense, let me know if you need anything explained further and thanks again for your help.

#2102255

Waqar
Supporter

Languages: English (English )

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

Thank you for waiting, while I performed some tests.

In the JS editor of the view "Test Map", you'll find this custom script, which detects any selection changes in the category field in the main results view and applies them to the category selection field in the view for the map. It also submits the search form in map view, when the submit button from the results view is clicked:


jQuery( document ).on( 'ready js_event_wpv_parametric_search_results_updated js_event_wpv_parametric_search_form_updated', function( event, data ) {

	var catSelect = jQuery(".wp-block-toolset-views-custom-search-filter select[name=wpv-category]");
	catSelect.change(function(e) {
		jQuery("select[name=wpv-category]").val(this.value);
	});

	jQuery(".wpv-custom-search-filter-submit input[type=submit]").click(function(){
		jQuery("form.js-wpv-filter-form-31 input[type=submit]").trigger("click");
	});
	
});

Although, this custom script is performing its part correctly, the challenge remains that when the view is updated through AJAX, it can't get initiated and requires that the whole page is refreshed.

This relates to how the Leaflet Map plugin works so, it would best to consult the plugin's author, to see if there is a method or callback function available which can be used to re-initiate the map, once the results have been updated through AJAX.

You're welcome to share any information or suggestion that you get from the plugin author.

#2104573

Thanks Waqar for looking into this, much appreciated. And thanks for the custom script, that's given me something to work with and I can see the issue is with the Leaflet plugin so will mark this as resolved.

Thanks

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