Hi there,
On a site, we have about 12 pages that use the same layout but use different views with maps.
I'm trying to get these to use a template, I create custom fields and then using an Elementor layout try and use Toolset views to populate these pages dynamically.
This is the page as it is now and it works great...we have a search bar, results grid and a map.
hidden link
Everything on a test page works fine other than the map. Is there any reason why the below code, added to a custom field would not appear dynamically on a page?
Is there known issue with dynamic data and Toolset maps?
This is the map code we are currently using:
[wpv-map-render map_id="map-family" map_height="93vh" fitbounds="off" cluster="on" street_view_control="off" general_zoom="10" general_center_lat="54.34" general_center_lon="-3.023"][/wpv-map-render]
It's not a big issue not to use a template, just asking as it would be handy to do so.
Many thanks, Pete
Hi Pete,
Thank you for contacting us and I'd be happy to assist.
To troubleshoot and suggest the best way forward, I'll need to see exactly how this custom field and template are being used on your website.
Can you please share temporary admin login details, along with the link to a page where this isn't working?
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.
regards,
Waqar
Hi there Waqar,
Hope you are well and keeping safe.
To recreate what I did yesterday means I have to change the sites layout, this I did yesterday and after finding I couldn't make this work, rolled the site back to a prev version.
What I did was created custom fields in Toolset for Pages, about 5.
I then, using Elementor created a Single Page Template and created fields using the dynamic settings to link to the Custom Fields.
Simple and straight forward and use this method for posts on the same site. However it wont work. The map wont work, the results were odd too.
Of course if I do this the page template takes over all the pages on the site so I have to go to pages I don't wish this to be applied to and change the template to override this setting.
I then thought, Gutenberg layout so not needing to use Elementor for these main pages, this here:
hidden link
However there's no dynamic option so why bother.
I guess, essentially I have 12+ pages that all look like this:
hidden link
And would like them all to use a template in Elementor or ideally not and using Gutenberg....Ideas most welcome however to recreate what I did yesterday may take me hours...if I remember how, and even then it didn't work.
Hi Pete,
Thanks for writing back and I apologize for the delay in getting back on this.
I'm not sure, exactly which type of custom field, did you tested this with, but on my test website, I was able to make it work using a "single line" type custom field.
1. I added a single line type custom field "Map Field" for pages.
2. On a test page's edit screen, I included your map's shortcode as a value in this new custom field.
( screenshot: hidden link )
[wpv-map-render map_id="map-family" map_height="93vh" fitbounds="off" cluster="on" street_view_control="off" general_zoom="10" general_center_lat="54.34" general_center_lon="-3.023"][/wpv-map-render]
3. Next, I created an Elementor template and assigned it to all single pages and inserted the shortcode for this new field, in a shortcode widget:
( screenshot: hidden link )
[types field='map-field'][/types]
4. As a result, on the front-end, the map's shortcode rendered the map correctly through the map shortcode that was saved as a value.
( screenshot: hidden link )
This way, the map's shortcode can be updated for each page and it will generate different maps accordingly, with a standard template.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
My issue is resolved now. Thank you!