Summary + Complete article
12 posts by 5 authors in: Forums > CMS Builder
Last Post: June 24, 2010 (RSS)
By svsanchez - June 24, 2010
Hello Chris, changing "documento" for "portada" does show the image, but not the PDF document to be downloaded. I need to show BOTH things:
- PDF download link (documento), and
- Little image (portada)
Thx!
- PDF download link (documento), and
- Little image (portada)
Thx!
Sven Sanchez
www.deguate.com
www.deguate.com
Re: [svsanchez] Summary + Complete article
By Chris - June 24, 2010 - edited: June 24, 2010
Hi svsanchez,
Okay, the simplest solution then is to copy Step 2a for each upload field you want to display. For example:
How's that?
Okay, the simplest solution then is to copy Step 2a for each upload field you want to display. For example:
<!-- STEP 2a: Display Uploads for field 'documento' (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 ($record['documento'] 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: ?>
<P><img border="0" src="images/download15x15.jpg" width="15" height="15">Descargar:
<a href="<?php echo $upload['urlPath'] ?>"> <?php echo $upload['filename'] ?></a><br/>
<?php endif ?>
<?php endforeach ?>
<!-- STEP2a: /Display Uploads -->
<!-- STEP 2a: Display Uploads for field 'portada' (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 ($record['portada'] 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: ?>
<P><img border="0" src="images/download15x15.jpg" width="15" height="15">Descargar:
<a href="<?php echo $upload['urlPath'] ?>"> <?php echo $upload['filename'] ?></a><br/>
<?php endif ?>
<?php endforeach ?>
<!-- STEP2a: /Display Uploads -->
How's that?
All the best,
Chris
Chris