Display an Embedded Google Map with Meta Box and Bricks Builder

Support MB Custom Post Type Display an Embedded Google Map with Meta Box and Bricks Builder

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #44215
    peterteszary@gmail.com[email protected]
    Participant

    Dear Support,

    I would like to ask for some help.
    I have a client website, where I would like to display a different Google Map location on each post.

    I am trying to do so:
    I have a custom post type with a wysiwyg editor custom field (this is where the embed Google Maps code goes to)

    Also using Bricks Builder's code block.

    So in the code block I would like to use this (I am not sure if it is correct):

    <?php
    $field_name = rwmb_meta('kepzes_terkep', ['object_type' => 'kepzes'], get_the_ID());
    echo $field_name;
    ?>

    To display the map. I don't want to use the map/api key method, because it is easier for the client to just copy/paste the embedded code to the custom post.

    But it is not working. It only shows the embedded code on the front end. The code execution toggle is on in Bricks Builder.

    Also, the wysiwyg editor saves the embedded code only in visual mode, not in text mode.
    (I have created several fields as well, to check if it is something wrong with the previous field (Save field value is on))

    Could you please help me?
    Thanks,
    Peter

    #44217
    PeterPeter
    Moderator

    Hello Peter,

    You should remove the second parameter 'object_type' in the helper function rwmb_meta(). It is used to set the object type term, setting, user of Meta Box only.

    The code to get the WYSIWYG field value would be:
    $field_name = rwmb_meta('kepzes_terkep', '', get_the_ID());

    Follow the documentation https://docs.metabox.io/functions/rwmb-meta/

    #44218
    peterteszary@gmail.com[email protected]
    Participant

    Dear Peter,

    thank you so much for your help! I'll try it out.
    May I ask if you have any suggestions for this:

    Also, the WYSIWYG editor saves the embedded code only in visual mode, not in text mode.
    (I have created several fields as well, to check if it is something wrong with the previous field (Save field value is on))

    Thanks,
    Peter

    #44225
    PeterPeter
    Moderator

    Hello,

    Please check if you can save some normal paragraphs in the Text mode. If not, please export the field group to a JSON file and share it here. I will import and check it on my demo site, following the documentation https://docs.metabox.io/extensions/meta-box-builder/#export--import

    #44678
    peterteszary@gmail.com[email protected]
    Participant

    Hello Peter,

    Unfortunately it is still not working. My Code in the code block is this:
    <?php
    $field_name = rwmb_meta('kepzes_terkep', '', get_the_ID());
    echo $field_name;
    ?>

    It only shows the iframe code (embeded code), but not the map itself.

    Any idea? Thanks,
    Peter

    #44685
    PeterPeter
    Moderator

    Hello,

    Please share your site credentials via this contact form https://metabox.io/contact/
    I will take a look.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.