Copy link to clipboard
Copied
My client is listing various suppliers on their website and wants to link off to their relevant social media channels.
Some suppliers have more social media channels than others - I'm using web apps and the detail page layout to display the information.
If a URL link to a social media channel is assigned to an image on the detailed page, how can I hide this image if no URL is detailed/provided in the relevant web app field?
I need to try and achieve this with Jquery or CSS as I can not use Liquid on this website due to laying out in Muse.
Any help is greatly appreciated.
Thanks!
1 Correct answer
Sure thing, render the web app into a hidden DIV straight after that use some javascript that loops the web app HTML DOM elements and removes whatever has "no data". Once competed unhide the DIV.
Copy link to clipboard
Copied
Sure thing, render the web app into a hidden DIV straight after that use some javascript that loops the web app HTML DOM elements and removes whatever has "no data". Once competed unhide the DIV.
Copy link to clipboard
Copied
You likely should be hiding it with liquid mark up.
If you add this tag it will hide it's self when it fails to load without jQuery.
<img onerror='this.style.display = "none"'>
