Custom Fields
Re-Envisioned
Support MB Views can’t display fields within a group, inside a loop

  • Creator
    Topic
  • #19507
    Resolved sofdesigne
    Participant

    Hi,

    i am trying to display fields within a group, in a loop
    but i can only display fields outside groups

    please help

    this is my code

    {% set args = {post_type: 'dossiers' } %}
    {% set mesdossiers = mb.get_posts( args ) %}
    
    {% for dossiers in mesdossiers %}
        <div class="singledossier">
        
            <a class="singledossiertitle" href="{{ mb.get_permalink( dossiers ) }}">{{ dossiers.post_title }}</a>
                    
            <div class="singledossiercontent">
                            
                {{ mb.rwmb_meta( 'select_rbth6eu8u1', '', dossiers.ID ) }}
                {{ mb.rwmb_meta( 'group_b30kbpp4roh.select_u6xr9smqot', '', dossiers.ID ) }}

    the second field will not display

    thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #19511
    Long Nguyen
    Moderator

    Hi,

    You should get the group value first (return an array) then access the field by bracket notation ['field_id']

    mb.rwmb_meta( 'group_b30kbpp4roh', '', dossiers.ID )['select_u6xr9smqot']

    #19513
    sofdesigne
    Participant

    thanks alot, it worked.

    really appreciate your support, but i really suggest you do some small videos about those very helpful functionalities that we can achieve with the plugin,

    in my case for example, a loop with some tricks on how to get different field types to show on the page, it’s so hard for someone with little programming knowledge like me to figure out what is needed for each situation, i everytime stuck somewhere. documentation is time consuming and i will always end up to post my issue,

    a beautiful plugin like meta box should have every bit explained in videos for non coders, this way it will be more popular, because the famous ACF is taking all the exposure even with it’s big logical problems.

    i really hope my words will encourage you to do some videos.

    and thanks again

    #19521
    Long Nguyen
    Moderator

    Hi,

    Thank you for the idea, I will take a note to create the video guides with MB Views and other extensions. Have a nice day.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
grid gear info copy caret-up caret-down trash