Display upload from first record only

3 posts by 2 authors in: Forums > CMS Builder
Last Post: December 5, 2016   (RSS)

I'm sure this must have been asked in the past but can't find it anywhere - how can I get a list page to display the upload from the first record only?
Records will be listed below with just their title/content and links to detail pages.

Thanks!

By ross - December 1, 2016

Thanks for posting.

One option is to use a counter like this:

<?php foreach($recordSet as $record): ?>

      <?php if (!@$counter++): ?>
      Code to display the image
      This will only run the first time
      <?php endif ?>

      The rest of your code  
      This will run every single time   

<?php endforeach ?>

Doest that make sense?  Give it a shot and let me know how you make out.

Thanks!

-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/