How to get Image Advanced URL in the terms loop in MBView?

Support MB Views How to get Image Advanced URL in the terms loop in MBView?Resolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36123
    indatext.comindatext.com
    Participant

    Hi, I am trying to get URL of image from term meta. It is Image Advanced field with a single image. So I believed that {{image_url}} reference in MBViews will get me URL, if I set such variable and store value from wp_get_attachment_image_src there, but it did not.

    {% set image_url = mb.wp_get_attachment_image_src( image_advanced_collection,'', full) %}
    
    {% for collection in collections %}
    <div class="background-collection" style="background:url({{image_url}})">

    How can I get URL from term meta in such MB View inside the "collections" FOR loop?

    #36129
    indatext.comindatext.com
    Participant

    I finally got it as:

    {% for collection in collections %}
    {% set image_upload = mb.get_term_meta( collection.term_id, 'image_advanced_collection', true ) %}
    {% set image_upload_link = mb.wp_get_attachment_image_src( image_upload, large) %}
    
    <div class="background-collection" style="background:url({{ image_upload_link [0] }})">

    using example from Jessica.

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