Element Conditions ability

Sorry for the silly question, but I am (an enthusiastic) beginner…
I now master, with Element Conditions tab, how to show or hide a static element (e.g. the fixed header for a field that I retrieve dynamically: “website: {je_acc_website}”) that is part of the same block as the loop query, but I cannot do the same thing if that element does not belong to the container that contains the query, but is in another container elsewhere on the webpage.
Is it possible to do this? Something like recalling, in the element condition, the query that belongs to the “so called” block? Can anyone help me? A big thanks in advance for the time I waste you on trivial matters :wink:

Hi @mollaflex,
could you describe what exactly you are trying to achieve? It is possible for the query count {query_results_count:query_id} to be accessed outside of the loop f.e., but you cannot access a field of a loop item outside of the loop.

In my case, for example, I would need to be able to activate the title of a section provided that a positive query result exists in the section, otherwise do not show the title, as in this attached image (If I enter the title in the query block, the condition works but it is repeated for each accessory).
However it could be useful on a thousand other occasions, e.g. to show up a banner somewhere when the accessory exists, etc. etc.

In that specific case you could work with the {query_results_count:query_id} Dynamic Data Tag (see also in the docs Dynamic Data – Bricks Academy ). In the element-conditions you could check if {query_results_count:query_id} > 0 and show the title / section only if the query has a result. You need to replace query_id with the id of the element that contains the query loop.

Br

Tobias

2 Likes

BIG TOBSEN !!! It’s work! (of the obvious :wink:
Thank you very much, you revealed me a whole virgin world to explore!!!

Thank a lot, but for the present this is unattainable for me :upside_down_face:

1 Like

No problem !

I completely agree :sweat_smile: