upload field

5 posts by 2 authors in: Forums > CMS Builder
Last Post: April 7, 2011   (RSS)

By maja13 - April 6, 2011

I have a page that includes a listing of pdfs that can be downloaded. In CMS Builder I added the field as an upload field type.

Is there anyway to get them to display with their title and not the filename?

Re: [maja13] upload field

By Jason - April 6, 2011

Hi,

What you can do is to use the 'info1' field instead of the 'filename' field when outputting your link. It may be a good idea though to default to the file name if no title exists.

You could try something like this:

<?php foreach($record['uploads'] as $upload): ?>
<?php
if ($upload['info1']) {
$linkText = $upload['info1'];
}
else {
$linkText = $upload['filename'];
}
?>

<a href = "<?php echo $upload['urlPath'];?>"> <?php echo $linkText;?> </a>
<?php endforeach ?>


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [maja13] upload field

By Jason - April 7, 2011

Hi,

If you edit your upload field, and look under advanced options, you'll see 5 text fields, info1 - info5. The first is used for title, but the actual name of the field is info 1.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] upload field

By maja13 - April 7, 2011

ahha! I needed to dig a little deeper. Thanks!