displaying file uploads

2 posts by 2 authors in: Forums > CMS Builder
Last Post: June 7, 2010   (RSS)

By paulmac - June 7, 2010


I'm adding a page that just has the option to download and view brochures as pdf files. The code I get from CMSB to insert in my page is as follows:

<!-- STEP 2a: Display Uploads for field 'brochure' (Paste this anywhere inside STEP2 to display uploads) -->
<!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
<?php foreach ($test_uploadRecord['brochure'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>

<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

<?php endif ?>
<?php endforeach ?>
<!-- STEP2a: /Display Uploads -->

I don't need the code to display thumbnails or images, the only thing I want it to display is the link to the brochure. How should I modify the code to do this?

I would like to have a title above the list of downloads, the title would simply be Brochures. I only want this to appear if there are brochures to display, so if no brochures are uploaded then the title does not appear.

Thanks for any help.