Subfields not displaying within Oxygen Custom Field/Meta Options

Support MB Group Subfields not displaying within Oxygen Custom Field/Meta OptionsResolved

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #27838
    Amanda RMAmanda RM
    Participant

    Hello,

    I created a group field with two sub-fields (rec_url & where_to_buy). These do not show up within the Custom Field/Meta Options within Oxygen Builder (see here).

    How can I insert these sub-fields? I do not know PHP, so I will likely need more detailed instructions if adding PHP will be necessary.

    Thank you!

    #27859
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Please follow the documentation to know how to get the subfield's value https://docs.metabox.io/extensions/meta-box-group/#getting-sub-field-values.

    and refer to your topic to run the PHP function with Oxygen https://support.metabox.io/topic/output-shortcode-from-a-custom-field/.

    You should have the basic knowledge of coding about PHP, HTML, CSS to do some advanced cases.

    #27865
    Amanda RMAmanda RM
    Participant

    Thank you for the links.

    I feel competent with html and css - not at all with php. Will php be necessary to be able to use the full functionality of Meta Box even when/if Meta Box integrates with Oxygen?

    Can you tell please me where I would input the following (snippet code or code block)?
    (It's a cloneable group)

    $group_value = rwmb_meta( 'group_id' );
    
    array(
        'sub_field_1_key' => 'sub_field_1_value',
        'sub_field_2_key' => 'sub_field_2_value',
        'sub_field_3_key' => 'sub_field_3_value',
        //...
    )
    
    $value = isset( $group_value[$sub_field_key] ) ? $group_value[$sub_field_key] : '';
    echo $value; // Display sub-field value
    
    array(
        array(
            'sub_field_1_key' => 'sub_field_1_value',
            'sub_field_2_key' => 'sub_field_2_value',
            'sub_field_3_key' => 'sub_field_3_value',
            //...
        ),
        array(
            'sub_field_1_key' => 'sub_field_1_value',
            'sub_field_2_key' => 'sub_field_2_value',
            'sub_field_3_key' => 'sub_field_3_value',
            //...
        ),
        //...
    )
    
    $group_values = rwmb_meta( 'group_id' );
    if ( ! empty( $group_values ) ) {
        foreach ( $group_values as $group_value ) {
            $value = isset( $group_value[$sub_field_key] ) ? $group_value[$sub_field_key] : '';
            echo $value; // Display sub-field value
        }
    }
    
    #28112
    Amanda RMAmanda RM
    Participant

    Hi again - can you please respond to my last message?

    #28119
    Long NguyenLong Nguyen
    Moderator

    Hi Amanda,

    Sorry for the late reply.

    You can use the PHP code anytime even the integration released. It can help you to do some advanced cases when the integration won't cover.

    I recommend using the Code Snippets to run the custom function.

    function my_custom_function() {
        $contacts = rwmb_meta( 'contacts' );
        if ( ! empty( $contacts ) ) {
            foreach ( $contacts as $contact ) {
                echo '<div class="contact">';
                echo '<h4>', 'Contact info', '</h4>';
                echo '<p><label>', 'Name:', '<label> ', $contact['name'], '</p>';
                echo '<p><label>', 'Email:', '<label> ', $contact['email'], '</p>';
                echo '<p><label>', 'Phone number:', '<label> ', $contact['phone'], '</p>';
                echo '</div>';
            }
        }
    }

    See the example for the cloneable group https://docs.metabox.io/extensions/meta-box-group/#examples

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

    Hello Meta Box Team,

    Is there any update about the integration?
    I am suppering with the same problem.

    Thanks,
    Peter

    #37201
    Long NguyenLong Nguyen
    Moderator

    Hi Peter,

    The Oxygen team has created the integration with Meta Box and MB extensions. Please contact Oxygen support to get more details.

    Thanks.

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