This topic is locked

View as Custom - Trying to display small image

7/2/2023 9:05:22 PM
PHPRunner General questions
A
asawyer13 authorDevClub member

I tried following the examples in the help but can't seem to get it to work.
I have this in the View as Custom.
if ($data["IsPrimary"] = 1) {
$value = ' <img src="images/star-24.png" alt="" />';
}
else
{
$value = '';
}
I am putting this in the IsPimary column but I think that's stil how you would do it.
Right now, no matter what the vaue in the IsPrimary field I get the star-24.png being displayed
Thanks for everyone's help.
Alan

W
wpl 7/3/2023

Alan,
you might try it like so:
if ($data["IsPrimary"] == 1) { $value = ' <img src="images/star-24.png" alt="" />'; } else { $value = ''; }

A
asawyer13 authorDevClub member 7/3/2023

WPI,
That fixed it
Sometimes I forget about ==
Thanks
Alan