Possible Conflict with Map Custom Field
- This topic has 13 replies, 3 voices, and was last updated 2 years, 4 months ago by
Unakriti.
-
AuthorPosts
-
October 8, 2022 at 9:13 PM #38599
Unakriti
ParticipantHi Support,
I have two custom field types Single Image and OSM Map on a standard WP Post. These work well on the backend - (1) users can upload an image and (2) set an address for the map to display - respectively,
However, the map does not display on the same post when the Single Image is also shown. When I remove the Single Image display block, then the OSM map starts to display.
Theme used for testing is Twenty Two Theme. I am using MB Views (shortcode method) to display these elements. No other pagebuilders or Gutenberg blocks are involved.
If you need it, I can provide such access for you to verify the scenario.
Kind regards,
October 9, 2022 at 2:37 PM #38602Unakriti
ParticipantHere's the MB Views code:
{{ mb.map( 'post.osm_id', '100%', '480px', '10' ) }}
Kind regards,
October 10, 2022 at 9:18 AM #38608Long Nguyen
ModeratorHi,
I do not see that issue on my demo site, here is a screen record https://monosnap.com/file/PBiqcNxALbX1XKrZktWg5bZ5tSqoHD
Can you please share the code that creates the custom fields and View code that outputs the field value on your site?
October 10, 2022 at 1:55 PM #38613Unakriti
ParticipantThanks for the Video, Long. In my scenario, the image and map custom fields are shown in separate views. Here's the requested code:
Custom Field - Single Image
<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Post PIN', 'your-text-domain' ), 'id' => 'post-pin', 'context' => 'side', 'fields' => [ [ 'name' => __( 'Title Pin', 'your-text-domain' ), 'id' => $prefix . 'single_image_5x4mtt49jj', 'type' => 'single_image', ], ], ]; return $meta_boxes; }
Custom Field - Text and Map
<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Location and Map', 'your-text-domain' ), 'id' => 'location-and-map', 'context' => 'side', 'fields' => [ [ 'name' => __( 'Enter Country, Region, or City', 'your-text-domain' ), 'id' => $prefix . 'text_8sy68td8rn7', 'type' => 'text', ], [ 'name' => __( 'Zoom Level', 'your-text-domain' ), 'id' => $prefix . 'osm_v4fb8cliwlo', 'type' => 'osm', 'address_field' => 'text_8sy68td8rn7', 'language' => 'en', 'region' => 'in', ], ], ]; return $meta_boxes; }
View - Image
<img src="{{ post.single_image_5x4mtt49jj.full.url }}" width="{{ post.single_image_5x4mtt49jj.full.width }}" height="{{ post.single_image_5x4mtt49jj.full.height }}" alt="{{ post.single_image_5x4mtt49jj.full.alt }}">
View - Map
{{ mb.map( 'post.osm_v4fb8cliwlo', '100%', '480px', '14' ) }}
Thank you and look forward to your advise to resolve this.
Kind regards,
October 10, 2022 at 2:33 PM #38615Unakriti
ParticipantPS: Here's a screenshot to illustrate the problem further.
Kind regards,
October 11, 2022 at 12:41 PM #38622Long Nguyen
ModeratorHi,
Please share your site credentials via this contact form https://metabox.io/contact/
I will take a closer look.October 11, 2022 at 4:17 PM #38625Unakriti
ParticipantThanks for your support, Long. I have shared the details, as requested.
Kind regards,
October 11, 2022 at 11:09 PM #38627Long Nguyen
ModeratorHi,
Thanks for sharing the info. I'm able to reproduce the issue on my demo site and I've escalated this issue to the development team to fix it in the next update. Meanwhile, you can add the shortcode to display the image first and the shortcode to display the map after. Screenshot https://monosnap.com/file/8JJpmHDaqk7viAFyIurbJKPqtVLDp8
October 11, 2022 at 11:12 PM #38628Unakriti
ParticipantThank you for the confirmation, Long. Appreciate your support.
I cannot change the order of the elements (image first and map second) because it won't fit into the article's flow.
Any ETA on the fix?
Kind regards,
November 11, 2022 at 3:58 PM #39067Unakriti
ParticipantHi,
Is this resolved now?
Kind regards,
November 13, 2022 at 2:58 PM #39096Peter
ModeratorNot yet, the development team is working on this issue. I will let you know when it is fixed.
December 7, 2022 at 5:55 PM #39581Unakriti
ParticipantThanks and eagerly looking forward to an update on this one!
December 9, 2022 at 9:02 AM #39626Peter
ModeratorHello,
Can you please update MB Views 1.11.4 or Meta Box AIO 1.16.7 to the latest version to fix this issue?
Let me know how it goes.December 9, 2022 at 11:04 AM #39632Unakriti
ParticipantYes, MB Views 1.11.4 does the trick. It's fixed.
Thanks MB and Peter.
Kind regards,
-
AuthorPosts
- You must be logged in to reply to this topic.