• Resolved Allan_James

    (@allan_james)


    Hi,

    I’m using Pods template, try to display an image based on selection in a relationship/select field.

    Have a relationship/select field called ‘ground status’ and will choose ‘Ground Open’ or ‘Ground Closed’ and want to display an different image/maybe a little text based on the choice.

    Looking at If / Else statement? dont know if that’s the best way, but cant find any documentation on it with field selection.

    Are you able to point me in the right direction?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Allan_James

    (@allan_james)

    Never Mind, below seems to do the trick,

                [if select_ground_status="Ground CLOSED"]
                 <img src="/wp-content/uploads/2019/01/GROUND-CLOSED.jpg">
                [else]
                    <img src="/wp-content/uploads/2019/01/GROUND-OPEN.jpg">
                [/if]

    Thanks

    Plugin Author Jim True

    (@jimtrue)

    Yep, that’s a method. I was going to suggest if the images are ‘static’ to just use a CSS class for that. But glad you figured it out.

    Plugin Author Jim True

    (@jimtrue)

    btw, I’m not sure the equivalency statement is actually working for you, there. We don’t support that kind of equals statement in our if template tags.

    I’d output the ground status as a class and use that to style it, or use a Yes/No Field if it’s only closed and open.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display Image based on field selection’ is closed to new replies.