Metabox group - Trying to diplay a nested group withion a group

Support MB Group Metabox group - Trying to diplay a nested group withion a group

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #44194
    JoeJoe
    Participant

    I am using the following code to display a group and a nested group, sadly the nested group's fields are not being displayed. both fields are also cloneable, i am using oxygen page builder and I am using this code in a codeblock, there is content in the nested group

    
    <?php
    $groups = rwmb_meta('article_section');
    echo '<div class="chapter-div-wrapper content-gap width--full">';
    
    foreach ($groups as $group) {
        // Field article_section_heading:
        $heading = $group['article_section_heading'] ?? '';
        // Field article_section_intro:
        $subtitle = $group['article_section_intro'] ?? '';
        // Get Wysiwyg in group
        $content = $group['article_section_content'] ?? '';
    
        echo '<div class="heading__div"><div class="toc-nav">' . $heading . '</div><h2 class="heading observe-me-x">' . $heading . '</h2><div class="section-header__catchphrase">' . $subtitle . '</div></div>';
        echo do_shortcode(wpautop($content));
    
        // Field article_section_inner_GRP:
        $inner_groups = rwmb_meta('article_section_inner_GRP');
    
        echo '<script>';
        echo 'console.log("Inner Groups:", ' . json_encode($inner_groups) . ');';
        echo '</script>';
    
        if (is_array($inner_groups) && !empty($inner_groups)) {
            foreach ($inner_groups as $inner_group) {
                // Field article_section_inner_heading:
                echo $inner_group['article_section_inner_heading'] ?? '';
    
                // Field article_section_inner_subtitle:
                echo $inner_group['article_section_inner_subtitle'] ?? '';
    
                // Field article_section_inner_content:
                $inner_content = $inner_group['article_section_inner_content'] ?? '';
                echo do_shortcode(wpautop($inner_content));
            }
        } else {
            // Handle the case when $inner_groups is not an array or is empty
            echo "No inner groups found";
        }
    }
    echo '</div>';
    ?>
    
    #44202
    PeterPeter
    Moderator

    Hello Joe,

    Please export the field group to a JSON file and share it here. I will help you to check the issue.
    Following the documentation https://docs.metabox.io/extensions/meta-box-builder/#export--import

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