When using a file field as a repeatable field for content I am accessing in custom templates like:
<?php
$CountDocs = count($cck->get('file_list')->value);
if ($CountDocs > 0 ):?>
<ul class="list-unstyled">
<?php foreach ($cck->get('file_list')->value as $gx):
The problem with file fileds is that the object exists when the document doesn't! So you end up with unwanted html around empty fields
I have worked around with below inside the loop
if(strlen($gx['document']->link) > 0 ):
But this is not what i want - I want to count the files that exist in the array
Is this possible? How?