Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm using the XML feed and don't want empty nodes when the field is empty in the view, I've thrown the code below into views-bonus-export-xml.tpl.php
<?php if($content): ?>
<<?php print $label; ?>><?php print $content; ?></<?php print $label; ?>>
<?php endif; ?>
This works fine but would be good to have this as an optional setting within the style options.
Comments
Comment #1
aasarava CreditAttribution: aasarava commentedThanks for the code snippet, timdiacon. That was very helpful. I was looking to do the same thing and agree with you that it would be good to have it as an option setting with the style options.