How to display a status custom field from ACF using Brick's condition?

Hi, Bricks community!

I am trying to display a custom field (Ex: Status) I created in ACF. There are 4 statuses as a selector field, as you can see in the screenshot of the ACF UI below.

In Bricks, I was trying to use the condition feature to try to display ONLY the status of “Vefkauf” (see Bricks UI screenshot), but all of the statuses are displayed.

Am I approaching this completely wrong? Any advice is greatly appreciated!


1 Like

Hi

With the ACF choice fields like Select, Checkbox, Radio Button, and Button Group, you have to add the :value filter to render the value instead of the label.

{yourfield} renders just the label
{yourfield:value} renders the value

So try with :value after the name of the acf field.

Cheers

Patric

Hi Patric,

Thanks so much for your reply! I tried it like that, and it still is not displaying the “Verkauf” on the front end. Does my condition setting look off? I appreciate your help! :slight_smile:

image

You didn’t read my post correctly!

You have to add :value in the Dynamic Data field.

{acf_objekt_status:value}

and in the last item you put the selection you want to check for, like

verkauf, verkauft, etc…

So sorry I misunderstood. A total Bricks noob kook here. I tried it like so. And it still is not displaying any data upfront. :cry:

Anyhoo, your advice is golden X100. Thanks a mill.

image

You have to add this condition below the element that has the query loop activated.

You can’t put it directly in the element that has the query loop activated.

Ok, I got it to work!

I did used the != instead, and it works like I want it to. Thanks so much for your advice, sir! Have a great holiday!

I am not sure that your solution will work as intended, because if I am right, your condition with != will always be true if you don’t put the condition under the query loop item.

I am not on the PC so I can’t simulate it.

When you say to “add the condition to the element below the query loop activated…” do you mean this? See screenshot. Thanks again!

Yes, exactly.

I am interested if I am right…

:grinning:

I will test it now. I will report back. So impressed that you can troubleshoot without your PC??

When I look at your image with the structure…

Did you make for each status a separate card under the query element?

If yes, then you have to add in the highest element of each separate card a condition with the status.

Haha, it looks like this when conditions are applied to the body layer. I will use the first solution for now because it serves what I need until I find a more efficient way to move forward. Thanks again. Your input was huge!!

It looks like that because I think you have all status cards under the item that has the condition.

My mistake, because I didn’t read your element structure properly.

So remove the condition from the element and add in the highest element of each status card the corresponding condition.

Anyway, however your element structure, now you know how to make a condition with an ACF choice field.

Enjoy working & investigating Bricks.

Thank you, sir, I added back the highest level of the card with the query loop and it works now. It successfully hides the unwanted statuses as you can see. I am a Webflow user but Bricks seems to be a very enjoyable builder! Thanks again!
:slight_smile:

1 Like

Just looking at your image with the structure, you have a lot of Divs…

Maybe you can look into making the cards structure much simpler.

I think you don’t need so many Divs.

Cheers

Patric

1 Like

You are correct. I was flying through it to play with the query feature. I will remove the “quick facts” div and simplify that area as you suggest.

:pray:

1 Like

Hi

now in front of PC.

I know you have your solution already, but I was still curious.

I see now why it looks like that when you apply the condition to the body layer.

This happens because the Image and Ribbon elements are on the same level as the body layer:

The condition does only apply to the elements below itself.

I also assume that the body layer element has the white card background, which would be the reason that the white card background appears.

To solve all that, you could insert one new block or div element above the card layer element, put all other elements below this new element and put the condition on this new element.

Cheers

Patric

2 Likes

Makes sense now! The loop must be applied to a wrapper block that holds all of the card elements. Here are my updated cleaned-up cards. TheBricks condition feature is pretty powerful!

Thanks for your tips! Now onto more troubleshooting in other areas! :sweat:

1 Like