Support Forum ยป User Profile

Forum Replies Created

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • in reply to: โœ…Single Image upload button not working #46263
    michael@wdsaigon.com[email protected]
    Participant

    Found out it was a bug with the jam.dev debugging recording tool. Spoke to the Jam.dev team, they are aware and releasing a patch. ๐Ÿ‘

    in reply to: โœ…Single Image upload button not working #46262
    michael@wdsaigon.com[email protected]
    Participant

    Hello Peter,

    Sent the details through however it 'seems' to be a rogue chrome extension causing the issue. I will report back if it is something different, thank you.

    in reply to: โœ…Single Image upload button not working #46251
    michael@wdsaigon.com[email protected]
    Participant

    Hello Peter,

    Thank you for the quick reply, I should have added within the original message that I had already tested this without plugins and default theme.

    I have took another video for you to see however: https://screencasts.wdsaigon.com/recordings/5PCJKnEKLIi2yd6P4BdA

    Many thanks

    Michael

    in reply to: โœ…Relationship Setup #44296
    michael@wdsaigon.com[email protected]
    Participant

    Sorry, It was a slow moment and now know how to dot it, please feel free to close/delete this.

    Many thanks

    michael@wdsaigon.com[email protected]
    Participant

    Hello Peter,

    Thank you so much!

    1. Doh, I must not have scrolled down far enough!

    2. Ah ok, I was not to sure if to include it or not/or even the ID of the tab for the settings page haha.

    Finally may I ask, is it possible to run that but without the page ID? Example, wherever there is a custom field named image_of_town on a post or page and the location_detailsimage_of_town_1 is saved it will update them all? Do I jusr remove the 110, from this string update_post_meta( 110, 'image_of_town', $new ); so it will read update_post_meta( 'image_of_town', $new );

    Again many thanks for your help!

    michael@wdsaigon.com[email protected]
    Participant

    Thanks Peter,

    Just sent them to you now.

    Many thanks

    michael@wdsaigon.com[email protected]
    Participant

    Hi Peter,

    Still does not work for me for some strange reason. I used 2021 theme with only MB plugins installed and added the code the them function.php file.

    Please see video for you to review:

    https://komododecks.com/recordings/FJ8dZstUsF8pm8Ghk7V6

    Many thanks

    Mick

    michael@wdsaigon.com[email protected]
    Participant

    Hello Peter,

    Again thank you for the quick reply, unfortunately It did not populate it and still shows the add media button in the page custom fields ๐Ÿ™ I did remove the condition as you advised so the new code is now:

    // Hook into rwmb_after_save_field action
    add_action( 'rwmb_after_save_field', 'update_target_field', 10, 5 );
    function update_target_field( $null, $field, $new, $old, $object_id ) {
        // Check if the saved field is 'image_of_town_1' and the object is a settings page
        if ( $field['id'] === 'image_of_town_1' && is_admin() ) {
            // Update the target field (image_of_town) on the post/page with the image URL
            update_post_meta( 110, 'image_of_town', $new );
        }
    }

    Here is the display code output of the image_of_town_1 in Metabox just so you can see I am using the correct ID's:

    This is a single image field in a tab in a settings page:

    <?php // Displaying uploaded image: ?>
    <?php $image = rwmb_meta( 'image_of_town_1', [ 'object_type' => 'setting', 'size' => 'thumbnail' ], 'mb-website-settings' ); ?>
    <h3>Logo</h3>
    <img src="<?= $image['url']; ?>">
    
    <?php // or simpler: ?>
    <h3>Logo</h3>
    <?php rwmb_the_value( 'image_of_town_1', [ 'object_type' => 'setting', 'size' => 'thumbnail' ], 'mb-website-settings' ) ?>

    Here is the single image field in the page custom field:

    <?php // Displaying uploaded image: ?>
    <?php $image = rwmb_meta( 'image_of_town', [ 'size' => 'thumbnail' ] ); ?>
    <h3>Logo</h3>
    <img src="<?= $image['url']; ?>">
    
    <?php // or simpler: ?>
    <h3>Logo</h3>
    <?php rwmb_the_value( 'image_of_town', [ 'size' => 'thumbnail' ] ) ?>

    I also double checked the ID of the page and it is 110.

    Many thanks again for your support.

    Kindest Regards

    Mick

    michael@wdsaigon.com[email protected]
    Participant

    Hello Peter,

    Thanks for the quick reply!

    Yes it seems the first example is the right solution, I did check the doc, but their is no example for updating other fields

    Does this look ok to you?

    // Hook into rwmb_after_save_field action
    add_action( 'rwmb_after_save_field', 'update_target_field', 10, 5 );
    function update_target_field( $null, $field, $new, $old, $object_id ) {
        // Check if the saved field is 'image_of_town_1' and the object is a settings page
        if ( $field['id'] === 'image_of_town_1' && is_admin() && get_post_type( $object_id ) === 'settings_page' ) {
            // Update the target field (image_of_town) on the post/page with the image URL
            update_post_meta( 110, 'image_of_town', $new );
        }
    }

    Many thanks

    Mick

    in reply to: โœ…Custom Field Group Not Saving #42509
    michael@wdsaigon.com[email protected]
    Participant

    That worked perfectly Peter, thank you for pointing me in the right direction, much appreciated!

    in reply to: โœ…Custom Field Group Not Saving #42474
    michael@wdsaigon.com[email protected]
    Participant

    Hi,

    It just refreshes with the toast bar as per screenshot, that is after I clicked publish.

    As per your request, I deactivated all plugins, activated 2023 and it still does not work.

    Here is the pastebin for the Location Fields that will not publish: https://pastebin.com/04fNmdK8

    Here is the pastebin to Company Fields that do publish: https://pastebin.com/3iYA797b

    Thanks

    in reply to: Render shortcodes in a loop via a template #41010
    michael@wdsaigon.com[email protected]
    Participant

    Hi Peter,

    Thanks for the reply,

    If it was not Bricks and I was applying it to say a Gutenberg loop, please could you let me know what the process would be? i.e. where to add the code you referenced in your last reply.

    Many thanks

    Michael

    in reply to: How to configure metabox for this scenario? #38583
    michael@wdsaigon.com[email protected]
    Participant

    Chao Long,

    I do not want to show only one of the Questions and Answers, I want to show the whole 5 Question and answer subfields from the fact post.

    But I will have many FAQ Posts, One FAq post with 5 questions about plumbing, one Faq post that has 5 questions about electrician, One faq post that has 5 questions about gas heating.

    One way to do it would be to add the Question and answer to every page instead of using a FAQ CPT. But because I have ten pages on electricans, 10 pages on plumbing, and 10 pages on gas heating, etc. Would mean I would have to copy and paste it 30 or 40 times. Instead, I would rather have the FAQs for each service have their own FAQ post, so I only have to add them to the site once and then query that Faq post using a custom field that is set on the page.

    P.s. Bricks does support cloneable groups.

    https://prnt.sc/kixoVR9NTnxD

    The only part I do not know how to configure is how the group is connected to the page by the value I enter in the custom field. Do I do this via a relationship or?

    I hope that makes sense?

    Many thanks Long

    in reply to: How to configure metabox for this scenario? #38576
    michael@wdsaigon.com[email protected]
    Participant

    Chao Long,

    Cam on for your reply.

    Ah, I will not use the cloneable group to query; I will use Bricks builder to query the group, but I want to know how to use the custom field on the page to use the FAQ post that has the right question and answers.

    For example, I have a template set up and the cloneable group FAQ Question & Answer selected with the subfields in a nestable repeater field (accordion, tabs, etc). On the individual pages where the template is applied, I have a custom field with the value of 'plumber' so I want it to choose the FAQ post in the FAQ CPT, which I have used to answer Plumber questions & answers.

    So if I go to the page about plumbers, then the question and answers on the page will be about plumbers.
    If I go to a page about Electricians, then the question and answers will be about Electricians.

    But not sure how to connect the two?

    Many thanks

    Michael

Viewing 14 posts - 1 through 14 (of 14 total)