How to display the Label of a Radio Field in a repeatable group field ?

Support MB Group How to display the Label of a Radio Field in a repeatable group field ?

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

    Hi,
    this is the code I am using, i am having the problem that I cannot display the label of the radio field : mthd_video_language (last line), the code displays the values 0, 1, 2 or 3, but I like to diplay the label which is english, german, french and italian, how can i achieve that ?

    <?php
    $groups = rwmb_meta( 'mthd_video_GRP' );
    foreach ( $groups as $group ) {
        // Field mthd_video_title:
        echo $group['mthd_video_title'] ?? '';
    
        // Field mthd_short_video_dsc:
        echo $group['mthd_short_video_dsc'] ?? '';
    
        // Field mthd_video_upload:
        echo $group['mthd_video_upload'] ?? '';
    
        // Displaying videos with HTML5 player:
        $videos = $group['mthd_video_upload'] ?? '';
    
        if (is_array($videos) && !empty($videos)) { // Check if $videos is a non-empty array
            ?>
            <h3>Uploaded videos</h3>
            <ul>
                <?php foreach ( $videos as $video ) : ?>
                    <li><video src="<?= $video['src']; ?>"></video></li>
                <?php endforeach ?>
            </ul>
            <?php
        }
    
        // Field mthd_video_url:
        echo $group['mthd_video_url'] ?? '';
        echo '<br>';
    
        // Field mthd_video_language:
        echo $group['mthd_video_language'] ?? '';
    }
    ?>
    #42564
    PeterPeter
    Moderator

    Hello Joe,

    It might be a complicated case to use the helper function rwmb_get_field_settings() to get the group settings and some loop to get the field label.
    Refer to this topic https://support.metabox.io/topic/show-label-of-select-chekbox-list/

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