In Metabox, I have made a relationship between a custom post type and a product.
In the single product template, I made a simple relationship query which lists the appropriate associated custom post titles in the builder
I thought to myself, maybe because this is a preview of a template and bricks is confused on specificity. So, I applied this template to the same product that I had used to populate content and then looked at the product itself on the font end
Same result - query loop returns nothing on the front end.
As a test, I then created a very simple text query loop to see what the issue is
And that list of post titles shows up just fine on the front end.
Not sure what’s going on.
I do have the relationship query loop inside a outer query loop (applied on the section), which is looping through a custom field group attached to the product. However, the queries are unrelated.
Unfortunately, I cannot reproduce the issue. Have you already tested it with Bricks 1.9.5? If it doesn’t work either:
Would you be so kind as to send temporary login credentials, information on where we have to look, and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase?
I also have problems mit MB Relationships not showing in Bricks 1.95.
In the backend it shows a querry result, but its standard posts, not from my connectec CPT. In the frontend there is nothing.
@lynxm is it showing the correct posts in the backend?
Interesting, no. I’ve never seen that problem before.
I’m sure you’ve already done this, but i would check your MB relationship set-up first. Kevin Geary actually has a good video walking through how to set it up properly (i.e., not reciprocal relationship, etc) with bricks
We discussed your issue internally.
As per my explanation, your setup will not work as the Relationship loop located inside a Group loop (nested). Hence, the context used is not correct.
However, we recorded this as an improvement task.
What we will do is, if the Relationship loop sit inside a nested loop, and the loop context is not a Post, User or Term, we will use the current page/post as the context. So it should do the job for your scenario.
Sorry for the spanish comments in the code but chatGPT helped me on that.
My scenario is similar:
Relation: Menu ->Dishes
Dishes have “dishes types” terms
I need to show the dishes grouped by their terms for every Menu CTP.
I’m currently using that custom code and it works, but I would like to use the query loop
I think I have the same problem. I have a query on a Metabox group and inside that i have another query for a Metabox relationship. It will just not work not matter what i do. Is this what you were describing is not possible? Has the improvement been made?