Custom Fields
Support Meta Box - Beaver Themer Integrator Query a post relationship in Beaver Themer

  • Creator
  • #32560

    hi there,

    Is it possible to use relationship as query in metabase / Beaver Themer?
    E.g. so I can show post module containing posts I have defined as related?

    Many thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
  • #32569

    This is what I'm talking about

    Cheers 🙂

    Long Nguyen


    Currently, the extension MB Relationships is not working with the module Posts of the Beaver Builder. I'm going to inform the developer team to consider adding it to the to-do list for the future development of the plugin.


    THanks Long,

    Much appreciated.
    To be honest I can achieve exactly what I need in views, but I don't know how to add if statement that checks if there are any items in the loop.

    E.g. if there are no related posts the don't display the "Related posts" text and the ul
    I know I am probably 2 lines away from this, but I can't figure it out (I tried some things but failed).
    Would you mind showing me the snippet? With this it is the last thing I could not achieve with ACF / Themer Integration.

    {% set relationship = attribute( relationships, 'test-rel' ) %}
    Related posts
        {% for post in %}
        <li><a href="{{ post.url }}">{{ post.title }}</a></li>
        {% endfor %}

    Thanks in advance!

    Long Nguyen


    You can check if there is a post in the relationship to show the word "Related posts" and code block inside the condition, just like this

    {% if is not empty %}
        {% for post in %}
            {{ post.title }}
        {% endfor %}
    {% endif %}

    Refer to this documentation of Twig


    Absolutely amazing. I was looking at this is not empty and it was one of the next "guesses" I was going to try - for some reason I didn't try it.

    This worked absolutely perfectly and it means that metabox no having this feature in this screenshot is not a problem at all - I can just drop a shortcode into my single post templates and in fact I can totally control the markup 🙂 - so this is no longer a problem 🙂

    Thanks very much!


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