Active
Project:
Views Bonus Pack
Version:
6.x-1.0-beta4
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Oct 2009 at 08:51 UTC
Updated:
4 Oct 2009 at 08:51 UTC
I created a CUSTOM label for each field in my xml export via views UI. I put a condition to check if the content is there in views-bonus-export-xml.tpl, and do not want to print the label when empty:
<?php foreach ($row as $field => $content): ?>
<?php if (!empty($content)): ?>
<?php $label = $header[$field] ? $header[$field] : $field; ?>
<<?php print $label; ?>><?php print $content; ?></<?php print $label; ?>>
<?php endif; ?>
<?php endforeach; ?>
I think I have tried to give any possible variations, but no matter what I failed. The label is still printed even when the content is empty. So how exactly to remove row (or its label) when the field content is empty in this particular template?
Any suggestion? Thanks