Dynamic PDF Links

5 posts by 2 authors in: Forums > CMS Builder
Last Post: February 19, 2008   (RSS)

By avrom - February 18, 2008

Hi again,

On my current client site where I am using CMSB, here is what I want to do. Upload PDF files, no problem there (I think).

But I want to automatically create a URL link to that file, so the client doesn't have to enter that and have it automatically link to that file when its listed on the page.

Doable or hire php programmer ?

Thanx so much
Avrom

Re: [virgodesign] Dynamic PDF Links

By Dave - February 18, 2008

Can you give me a bit more detail on how you want that to work?

There's a few options. You can upload pdfs through the wysiwyg (by enabling uploads and allowing .pdf) and then upload them by clicking the link button and then browse.

You could upload them through an upload field and have download links automatically added to the display page.

Are either of those close?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Dynamic PDF Links

By avrom - February 18, 2008

Hi Dave,

Almost! I would like to upload the pdf through an upload field and have a link attached to the file name (specified by the user).

i.e. ThisPDFfile (as the user named it) has an embedded link to the uploaded file.

Cheers, does that make sense ?

Much thanx.

Re: [virgodesign] Dynamic PDF Links

By Dave - February 19, 2008

Ok. So you want the client to be able to specify the text that is displayed in the link to the PDF? Is that right?

If you're using a recent version of CMS Builder you can specify the Title and Caption for each upload (and those fields can be added in the field editor).

Instead of the standard code that displays an upload:

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

You could have it display the title (info1) or caption (info2) or another field you add (info3,4,5) in the link like this:

<a href="<?php echo $upload['urlPath'] ?>"><?php echo $upload['info1'] ?></a><br/>

Would that work?
Dave Edis - Senior Developer
interactivetools.com