I am creating a Custom List for a Frontend view of a CC connection. One of the fields in the connection is named 'staff_website'. This field (VARCHAR(150)) either contains a website URL, or the text "No Website". In the Frontend view, I would like my list to add a hyperlink if there is a URL in the field, but display "No Website" if there is not.
In the Custom List, I have the following to evaluate the value of 'staff_website':
However, this code merely returns the value of 'staff_website' for every row. If I use:
the code returns "None" for every row. I am missing something basic in here, but no matter what I try I cannot get it to work.
In the Custom List, I have the following to evaluate the value of 'staff_website':
<?php
$mysite = "{staff_website}";
if ($mysite == "No Website") {$showsite = "None";}
else {$showsite = "{staff_website}";}
echo $showsite;
?>
However, this code merely returns the value of 'staff_website' for every row. If I use:
<?php
$mysite = "{staff_website}";
if ($mysite = "No Website") {$showsite = "None";}
else {$showsite = "{staff_website}";}
echo $showsite;
?>
the code returns "None" for every row. I am missing something basic in here, but no matter what I try I cannot get it to work.