NO BUG: Functions doesn't work anymore fine, one function control the others

Browser: Chrome 110 and Firefox last version
OS: Windows
URL: https://porticciolo.salone24.it/categorie-offerte/walking-tours-offerte/
https://porticciolo.salone24.it/categorie-offerte/excursions-offerte/
https://porticciolo.salone24.it/categorie-offerte/events-offerte/
https://porticciolo.salone24.it/categorie-offerte/private-experiences/

I have 4 functions on 4 different divs and each divs it has element rich text. Each function takes a different dynamic field. The functions are set up as follows:
Dynamic data > name of the dynamic field > != > hide

With pods I created 4 yes/no radio buttons and as “yes” I entered the text “show” and as “no” I entered the field “hide”.

So this way I can decide which text i want to show and which text i want to hide.

Everything worked fine with version 1.7 but upgrading to version 1.7.1, the pages only see the text of one function, always the same, even for all the pages that have different functions.

If I hide the function that is visible on all pages via the “hide” radio button, I no longer see any text.
It is as if one function prevailed over the others or controlled the others.

The functions that seems to controll all the others functions it’s the functions with the dynamic data that you can see on the image attached

What happened? is it possible to fix it? Thank you

Hi Davide,
Thanks so much for your report!

First of all, a basic understanding/terminology question: by “functions” you mean “conditions”, right?

Would you be so kind as to send temporary login credentials and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase?

Best regards,
timmse

Hi timmse, of course conditions
sorry :slight_smile:
I sent an email with the parameters, let me know please.
Thanks
Davide

@timmse ok we got it, the problem it was this and the Bricks assistence told me this:

I noticed you are using dynamic fields from a post type on condition check:
{pods_offerte_categoria_link_events},
{pods_offerte_categoria_link_excursions},

{pods_offerte_categoria_link_walking_tours},

{pods_offerte_categoria_link_vip_experiences}

Since it’s on an archive template, these fields will be returned empty because in the archive page, no post will be using (Unless you are inside a post loop)

I understand that you were able to get it work in previous version as it was a bug that we fixed it in 1.7.1
The previous version always get the 1st post of the archive result that’s why you can get the dynamic value.

If you really want to use this same logic in archive page (which I don’t think this is the correct way), you should wrap them into a query loop and set posts per page to 1, so you can get the correct dynamic data for condition check.

Alternatively, you should use some useful function from WordPress to detect what category page you are currently, to conditionally output your content.
Example:
{echo:is_tax(‘categorie_offerte’,‘events-offerte’)} - Check if currently is https://porticciolo.salone24.it/categorie-offerte/excursions-offerte/
{echo:is_tax(‘categorie_offerte’,‘excursions-offerte’)} - Check if currently is https://porticciolo.salone24.it/categorie-offerte/excursions-offerte/

So i used Echo and now it works.
Thanks

1 Like