There are a few things you can do, you could use bubble’s composer to split the result,
so code block to add an image to the menu,
using the blank img i have left to = or contain something relevant to your image. Then you can use the formatted as text to,
making the yes = the same img search & the no = another img that will show if the first isnt available.
Another approach is to add some fallback code in your <img>
elements,
<img src="http://lofrev.net/wp-content/photos/2017/05/Online_logo_2.png" onerror="if (this.src != 'http://lofrev.net/wp-content/photos/2017/05/Online_logo_2.png' || this.attribute('src') != 'http://lofrev.net/wp-content/photos/2017/05/Online_logo_2.png'); this.src = 'http://oaklandtech.com/staff/files/2017/11/unnamed.png';">
breaking down the above code,
the src=
attribute is where you provide your preferred image’s url.
the onerror=
attribute is where we are going to place some javascript to deal with the preferred image failing.
Looking into what the onerror
script is doing you could explain it like this,
if the src
property or attribute’s image url does not = the image url you preferred, then show this other url (the last url in the onerror attribute).
A lot of the method you choose should be choosen based on your use case, a good example could be an image board type site - you dot want a bunch of missing images, text saying no image available or a secondary image with an error icon so a good way is when a user uploads an image, grab its base64 as text - then make your preferred src
or “source” point to the data url like so -
<img src="data:image/png;base64,YOUR_BASE_64_HERE">
This will mean that even with the user not having the internet as long as the page loaded (locally or remotely) then the images will be there due to the entire image being contained within the base64.