Display image from Custom Setting Group

Support MB Settings Page Display image from Custom Setting GroupResolved

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36270
    JoeJoe
    Participant

    Hi,

    I have setup a setting page for team members

    <?php $teams = rwmb_meta( 'team_group', ['object_type' => 'setting'], 'custom_settings' ); ?>
    <ul>
    <?php foreach ( $teams as $team ) : ?>
    	<li><?php echo $team['team_member_image'].' -> Name '.$team['team_member_name']; ?></li>
    <?php endforeach; ?>
    </ul>

    The code works fine, but instead of the image I get the ID of the image displayed, how can I display the image

    For the image I am using the field type : Single Image

    #36274
    Long NguyenLong Nguyen
    Moderator

    Hi Joe,

    Please follow this documentation to know how to display image field value on a settings page https://docs.metabox.io/extensions/mb-settings-page/#getting-field-value

    $image = RWMB_Image_Field::file_info( $team['team_member_image'], array( 'size' => 'thumbnail' ) );
    echo '<img src="' . $image['url'] . '">';
    #36277
    JoeJoe
    Participant

    Thank you very much, it works, i had the same line of code, i think , duhhh

    cool thanks 🙂

    #36289
    JoeJoe
    Participant

    I am really sorry to bother you again ...

    I also have a checkbox List that has an ID team_member_position

    This does not work :

    <?php $values = rwmb_meta( 'team_member_position' ); ?>
    			
    <ul>
        <?php foreach ( $values as $value ) { ?>
            <li><?php echo $value; ?></li>
        <?php } ?>
    </ul>

    I have checked the docs, and basically none of the solution fits, because this is a list of multiple choices AND cloneable values, can you pls help me one more time.

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