How to display Meta Box taxonomy term image from a Taxonomy Advanced field inside an MB Group Query Loop?

Hi Bricks team,

I’m trying to display a taxonomy term image inside a Meta Box Group query loop.

Environment

  • Bricks: 2.3.9

  • Meta Box: 5.13.1

  • Meta Box AIO: 3.9.0

Data structure

Insight Post

Trusted References (MB Group)
├── trusted_organization (Taxonomy Advanced)
├── reference_title
└── reference_url

The Trusted Organization taxonomy has a custom Meta Box field:

organization_logo

(Field type: Single Image)

Current status

The organization name renders correctly using:

{mb_insight_trusted_references_trusted_organization}

For example, it correctly displays:

World Health Organization (WHO)

However, I cannot access the taxonomy term’s custom image field (organization_logo) from inside the same MB Group query loop.

What I’ve tried

  • Storing the logo inside the group (works, but duplicates data)

  • Moving the logo to taxonomy term meta (preferred architecture)

  • Using the taxonomy field dynamic tag

  • Creating custom dynamic tags with PHP

  • Using rwmb_meta() with object_type => term

The organization name works correctly, but I cannot retrieve the logo for the selected taxonomy term.

Goal

My goal is to normalize my data.

Instead of storing the organization logo inside every Trusted Reference, I moved the logo to the Trusted Organization taxonomy.

Now I need to display that taxonomy logo while looping through the Meta Box Group in Bricks.

The organization name already displays correctly using:

{mb_insight_trusted_references_trusted_organization}

Only the taxonomy image (organization_logo) is missing.

Question

Is there a native Bricks dynamic tag or documented API to access taxonomy term meta from a Taxonomy Advanced field inside a Meta Box Group query loop?

If custom code is required, what is the recommended Bricks hook or API for accessing the current Meta Box Group item?

Has anyone implemented this successfully, or is there a recommended Bricks approach for accessing taxonomy term meta from within an MB Group query loop?

Thank you!

See if outputting the image as url (instead of id) works

Dynamic Data | Bricks Academy .

where the object request becomes: organization_logo:url

Have you seen this post?

Thanks for the suggestion! I tested all of these:

organization_logo
organization_logo:url
{mb_organization_logo:url}

Unfortunately none of them worked. They all produced the same broken image URL ending with %7B (encoded {), which makes me think Bricks isn’t parsing the dynamic value in this context rather than failing to convert an image ID to a URL.

My setup is a bit different because the image belongs to a taxonomy term selected via a Meta Box Taxonomy Advanced field inside an MB Group Query Loop, not directly to the current query object.

I appreciate the suggestion though—it was definitely worth testing.

Thanks for sharing that thread! I had a look through it.

From what I can tell, that example uses a taxonomy assigned directly to the current post and then queries the post’s terms with a nested Terms Query Loop. In my case, the taxonomy term isn’t assigned to the post directly—it’s selected through a Meta Box Taxonomy Advanced field inside an MB Group Query Loop.

So the data structure is:

Insight Post
└── MB Group
    └── Taxonomy Advanced field (trusted_organization)
         └── organization_logo (term meta)

I also tested organization_logo, organization_logo:url, and {mb_organization_logo:url}, but they all resulted in the same broken URL, so I don’t think it’s an image format issue.

Unless there’s a way to make Bricks switch the object context from the MB Group row to the selected taxonomy term, I suspect this specific use case may not be supported yet.

Give me a sec and I will see what I can come up with – stay tuned.

Ok, So I am not 100% sure of your structure, but I will give it a go.

Here is a little video of what I think you are trying to achieve. Have a look and let me know.

Video: https://drive.google.com/file/d/1ZBwTPvh9bgGuYI4E8Lh9CFTDPG3cLl8-/view?usp=sharing

1 Like

Thanks so much for taking the time to record the video—it really helped.:two_hearts:

I think I spotted one important difference though.

In your example, the taxonomy (Career Category) is assigned directly to the current Career post, so the nested Taxonomy Query with Current Post Terms works perfectly.

In my setup, the organization taxonomy isn’t assigned to the Insight post itself. Each Trusted Reference is an MB Group row containing a Taxonomy Advanced field (trusted_organization), so the selected organization only exists inside that group item.

The structure is more like:


Insight
└── Trusted References (MB Group)
    ├── trusted_organization (Taxonomy Advanced)
    ├── title
    └── url

So I’m wondering if there’s a way to make the nested taxonomy query use the taxonomy term selected in the current MB Group row, rather than the current post’s assigned terms.

Hey there, I am sorry, but I am not 100% sure on what you are trying to achieve.

Are you able to do some screenshots of your current markup or a video?

here is a link to the tutorial page from metabox where they discus how to apply a image to a category and display it.

These contain tutorials how to do this is in:

metabox + metabox views

metabox + bricks

ect.

If you want to display something from outside the query you might need to cheat it in. Or use “if” statements on a template, or use attributes assignt to something to remove css display:none; from inside the css box to show the image (where all the images are in there on display:none and you “fix" the one you need by the attribute from the Trusted References (MB Group). So its sort of cheating but if it works its fine.

Thanks! I think screenshots will explain it better than I can.

The important part is that trusted_organization is not assigned directly to the Insight post. It is a Meta Box Taxonomy Advanced field inside each MB Group row.

I’m trying to display the organization_logo field from the selected taxonomy term.

Insight Post
│
└── Trusted References (MB Group)
      │
      ├── trusted_organization (Taxonomy Advanced)
      │        │
      │        └── organization_logo
      │
      ├── reference_title
      └── reference_url

Screenshot 1 — Meta Box Group Structure

1. This is the Meta Box Group used inside each Insight.

Each Trusted Reference row contains:

  • trusted_organization (Taxonomy Advanced field)

  • reference_title

  • reference_url

Insight
└── Trusted References (Group)

Screenshot 2 — Organization taxonomy fields

The Trusted Organization taxonomy has its own custom field named organization_logo.

This field stores the logo for each organization.

Trusted Organization
    └── organization_logo

Sorry about the broken URLs :sweat_smile:. As a new member I’m hitting the XenForo link limit, so I had to insert a space after https://. Just remove that space and the links will work normally.

https:// i.postimg.cc/kG9KfNw3/Screenshot-3-Example-taxonomy-term.png

Screenshot 3 — Example taxonomy term

Example taxonomy term (WHO).

The WHO term has an image assigned to the organization_logo field.

https:// i.postimg.cc/x8YMtGgS/Screenshot-4-Bricks-template.png

Screenshot 4 — Bricks template

This is my Bricks template.

Inside the Meta Box Group query loop, the Image element is trying to display the organization_logo field from the taxonomy term selected by the Taxonomy Advanced field.

https:// i.postimg.cc/9FLZY79V/Screenshot-5-Result.png
Screenshot 5 — Result

The titles and URLs display correctly from the MB Group fields, but the organization logo does not.

The Image element shows a broken image instead.

Ok, I see it now. I can do up a video if you need, but it is a simple fix. See images below.

All you need to do is query the “Block” that the logo is in. You are already query the post type “Insights” on the reference-item, but now you have to drill down a bit and then query the taxonomy “Trusted Organization” as that is where the custom field (logo) is being held.

Again, when you are querying the taxonomy, make sure to check the “Current Post Term”, then it will apply the logo to the posting and not all the logos.

Let me know how you get a long.

Cheers

Thanks! I tested it exactly as shown in your screenshots.

I added the nested Terms query on the inner Block:

  • Type: Terms

  • Taxonomy: Trusted Organizations

  • Current Post Term: Enabled

Unfortunately, the nested query doesn’t return any terms in my setup. The Image element doesn’t even render anymore, so it looks like the Terms query itself is returning zero results.

I think the difference might be that my Insight posts don’t have Trusted Organizations assigned directly as a taxonomy.

Instead, each Trusted Organization is selected inside the Meta Box Group using a Taxonomy Advanced field:

Insight Post
└── Trusted References (MB Group)
    └── trusted_organization (Taxonomy Advanced)

Do you think Current Post Term only works with taxonomy terms assigned directly to the current post, or should it also resolve the Taxonomy Advanced field inside the current Meta Box Group row?

Sorry, then I am not sure what else I can do for you here. I was able to get things working based on the conditions you have set, but not sure why they are not being applied for you.

1 Like

Thank you so much for taking the time to help me with this, especially the video and all the detailed replies. I really appreciate the effort you put into investigating it. :bouquet:

Since you were able to get it working in your environment, I suspect there may be something specific to my setup that we haven’t identified. I don’t want to take up any more of your time.

Thanks again for all your help—it was genuinely appreciated! :blush:

1 Like

No worries, sorry I couldn’t find the solution for you. But you are right, there might be a setting someone that is just making it miss what you are looking for – hopefully you or someone else can find that little tweak. =]

1 Like