How do you display an image/icon based on some logic.

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I would like to display a image(static resource) or icon based on the value of a field.  sort of like..

if 1=blue.jpg
if 2=red.jpg
Photo of Jaime

Jaime

  • 1,220 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Jaime,

A few ways to tackle this, but if you have a limited number of options, just add an image component to your page for each one, and conditionally render them.
Photo of Jaime

Jaime

  • 1,220 Points 1k badge 2x thumb

thanks Matt...I could have sworn I saw a post for doing this with either css or a snippet.  I just can't seem to find it.  A custom renderer?