Display clone fields inside a relationship loop

Support MB Views Display clone fields inside a relationship loopResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #36370
    Chris PChris P
    Participant

    Hi,

    I'm stuck, can't seem to figure out how to display clonefields in a relationship loop

    {% set gargs = {post_type: 'grille', nopaging: true, relationship: {id: 'radiator-grille', from: post.ID} } %}
    {% set grilles = mb.get_posts( gargs ) %}			
    {% for grille in grilles %}
    			<li class="jaga-card col-6 col-md-3 col-lg-2">
    				<a href="{{mb.the_permalink(grille.ID)}}">
    					{% if   mb.get_the_post_thumbnail( grille.ID, 'thumbnail') %}    
    					{{ mb.get_the_post_thumbnail( grille.ID, 'thumbnail') }}     
    					{% else %}
    					<img src="placeholder-150x150.png" />
    					{% endif %}
    					<h4>{{ grille.post_title }}</h4>
    					{% for clone in post.group_fwdwryesb7q %}
    						{{ clone.text_sppju67l5ln }}
    						<img src="{{ clone.single_image_83x8utmqg6l.thumbnail.url }}" width="{{ clone.single_image_83x8utmqg6l.thumbnail.width }}" height="{{ clone.single_image_83x8utmqg6l.thumbnail.height }}" alt="{{ clone.single_image_83x8utmqg6l.thumbnail.alt }}">
    					{% endfor %}
    				</a>
    			</li>
    			{% endfor %}

    How do I get the clone fields to display?

    A little example would be great.

    Thanks in advance.

    Br,
    Chris

    #36382
    Long NguyenLong Nguyen
    Moderator

    Hi Chris,

    Which is the post type that the cloneable group group_fwdwryesb7q is associated with? If it is the post type grille then you can use this code

    {% for clone in grille.group_fwdwryesb7q %}

    #36391
    Chris PChris P
    Participant

    Yes correct, that worked like
    a charm. Thanks Long!

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