This topic is locked

If statements

11/4/2008 8:33:33 AM
PHPRunner General questions
S
sporrencense author

HI,
Using previous versions of PHPRunner i.e. 4.0 (I am currently using 5.0 build 587) in order to hide empty fields I used the following:

{if $row.1Notes_value!=""}<p><strong>Notes:</strong> {$row.1Notes_value}</p>{/if}


I've tried using the same in PHPRunner 5 projects e.g.

{if $Secondary_Contact_Name_value!=""}{BEGIN Secondary_Contact_Name_fieldcolumn}<TR><TD class=headerlistdown_v style="PADDING-LEFT: 10px"

width="30%">Contact Name</TD><TD class=shade_b style="PADDING-LEFT: 10px"

{$Secondary_Contact_Name_style}>{$Secondary_Contact_Name_value}&nbsp;

</TD></TR>{END Secondary_Contact_Name_fieldcolumn}{/if}


but it doesn't seem to work - could you point me in the right direction please?
Thanks
Ben

J
Jane 11/5/2008

Ben,
use List page: After record processed event for this purpose.

Here is a sample:

if ($data["Notes"])

$row["Notes_fieldcolumn"]=true;

else

$row["Notes_fieldcolumn"]=false;

S
sporrencense author 12/5/2008

Jane,
Thanks for the info.
I'm wondering also how to hide empty fields on a 'view' page?
Your help is much appreciated.
Ben

J
Jane 12/5/2008

Ben,
use View page: Before display event on the Events tab for this purpose.

Here is just a sample:

if ($values["Notes"])

$xt->assign("Notes_fieldblock",true);

else

$xt->assign("Notes_fieldblock",false);

S
sporrencense author 12/8/2008

Thanks Jane.

Ben,

use View page: Before display event on the Events tab for this purpose.

Here is just a sample:

N
nicolagrimshaw 1/22/2009

Ben,

use View page: Before display event on the Events tab for this purpose.

Here is just a sample:


This is great - been trying to figure this out for ages!
Thanks Jane