0

I have a content type called 'Documents' which has 2 fields: title and file. There can be attached multiple files the file field.

But how can I show the upload date for every single file? I have tried using Views, but could only get the upload date for the first file, not the rest of the files.

How can I do this?

1 Answer 1

0

I fixed it using this solution https://www.drupal.org/node/1578484

function mytheme_file_formatter_table($variables) {
  $header = array(t('Attachment'), t('Size'), t('Date'));
  $rows = array();
  foreach ($variables['items'] as $delta => $item) {
    $rows[] = array(
      theme('file_link', array('file' => (object) $item)),
      format_size($item['filesize']),
      format_date($item['timestamp'], $type = 'short'),
      );
  }
  return empty($rows) ? '' : theme('table', array('header' => $header, 'rows' => $rows));
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.