If statement = to list item

3 posts by 2 authors in: Forums > CMS Builder
Last Post: February 8, 2012   (RSS)

By RGC - February 8, 2012

I am trying to display the words Under Contract when the Status for a list item is equal to Under Contract. The if statement I am using is as follows:

<?php if($record['status']==['Under Contract']): ?>
<tr>
<td colspan="2"class="burgundyFont" >UNDER CONTRACT</td>
</tr>
<?php endif ?>

Something is not correct as the page generates a syntax error
Thanks for your help!
Rod

Re: [rgc] If statement = to list item

By (Deleted User) - February 8, 2012

Hi rgc,

You're close but you don't need the extra square brackets around the test value:
<?php if ( $record['status'] == 'Under Contract' ) : ?>
<tr>
<td colspan="2"class="burgundyFont" >UNDER CONTRACT</td>
</tr>
<?php endif; ?>


Let me know is that helps,

Tom