How show alternative content if some element from query is empty?

Hi I have category querry loop in Block elemnt with image and heading (screen). Some categories do not have their own image, and I would like to put an alternative one instead, so that there is no empty space.

These categories exists so I think, I cannot use “no results - template”.

But I I tried it too. Use “no results - template” thinking that it could insert the image from the template where there is no data for the image, but it doesn’t work.

image

I also tried hide whole block when I do not have dynamic image. Used solution from this question Condition for checking a dynamic data field for not-empty or is null - #2 by prj But it hides everything
image

How to get both versions of the solution up and running?

Hi,

I think this is what you´re looking at:

Captura de pantalla 2024-05-02 180351

You want to have 2 image blocks and show only one depends on the content.

Product category image for your categorie image:

image

Your custom image that will replace the empty image category:

image

Note that this image will be the same for all non image categories.

And now the conditions to show one or another

Show Product category image:

image

Show custom image:

image

Result:

All cars are my custom image but the category with image does not get replace.

Sorry for the images, but this site is only for playing around :sweat_smile:

Cheers!

Wow! Good idea! Thank you, I need to learn to think out of the box more. It wasn’t necessary with Elementor :smiley: