Forums » How can I display last file?

RSS feed for this topic

Info

Tags

  1. Hi
    How can I display the last file uploaded for each item?

    Thanks

  2. Something like this should work (depending on where you're trying to do this you may also need to do $item = get_current_item() before this code).

    $filesForItem = $item->Files;
    $lastFile = end($filesForItem);
    echo display_file($lastFile)
  3. Thank you, John!
    I did it:

    <?php while(loop_files_for_item()):
    $filesForItem = $item->Files;
    $lastFile = end($filesForItem);?>
    <?php endwhile; ?>

    " title="Download "<?php echo item_file('Dublin Core', 'Title'); ?>""> Download


Reply

You must log in to post.