Hello people. I am trying to use an IF statement to display a list of data only if it has been entered by a user. If it is not present then nothing is displayed.
However the only thing I can achive is the list, but each item has the section heading "for fans of:" in front of it. I would like to have the section heading, with a list displayed underneath it (he heading also only being displayed when values are present.
The code I am using is:
<?php
foreach ((array)$field_for_fans_of as $item) {
if($item['view']){
?>
<div class="field-item"><b>For fans of:</b> <?php print $item['view'] ?></div><br>
<?php }}?>
The effect I want to create is as follows:
For fans of:
item #1
item #2
item #3
The effect I want am getting is as follows:
For fans of: item #1
For fans of: item #2
For fans of: item #3