Adding php to Header code in List Display

chriso0258 15 Mar, 2016
Hello,

I'm trying to change the heading information in CC based on the conditional statement. For example, given the following condition in the model:
<?php
return array("site" => 1);
?>

I want to display BCCX Camera Data. If site => 2, I want to say MCCX Camera Data.
In the Front List->List Display->Table section I've tried using
<?php
if (bccxCameras.site == 1)
{
echo "BCCX Camera Data";
}else if (bccxCameras.site == 2)
{
echo "MCCX Camera Data";
}
?>

as well as
<?php
if ($form->data[bccxCameras]['site'] == 1)
{
echo "BCCX Camera Data";
}else if ($form->data[bccxCameras]['site'] == 2)
{
echo "MCCX Camera Data";
}
?>


But the text does not show up on the screen. How should I write the php code?

Thanks for your assistance.
Chris
chriso0258 15 Mar, 2016
Answer
Please disregard the post. I'm not sure what I was thinking 😶 The conditional statement in model will not change.
GreyHead 15 Mar, 2016
Hi chriso0258,

How can you know which value is correct - you can’t use a value from a row in the listing because it might vary between rows? Is this a filter value of some kind?

Bob
This topic is locked and no more replies can be posted.