Linking to a file uploaded from CGBlog summary page [SOLVED]

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
sam_m
Forum Members
Forum Members
Posts: 34
Joined: Thu Jun 11, 2009 11:59 pm

Linking to a file uploaded from CGBlog summary page [SOLVED]

Post by sam_m »

Hello,

Im using CMSMS 1.10.3 and CGBlog 1.9.8

I wonder if anyone can advise, im trying to get the blog setup so when a file has been uploaded (pdf for example) a link to this is shown on the summary template within CGBlog, but I can`t figure out the correct code which needs to be entered within the summary template to allow a direct link to the uploaded file.

At the moment im working around with this code...

{if !empty($entry->fieldsbyname.upload->value)}
<a href="{$entry->file_location}">Click here to view file</a>{/if}


But it only links to the directory and not the file directly

Any help would be greatly appreciated

Thanks very much
Kind Regards
Sam
Last edited by sam_m on Thu Jul 05, 2012 1:00 pm, edited 1 time in total.
uniqu3

Re: Linking to a file uploaded from CGBlog summary page

Post by uniqu3 »

{$entry->file_location} is only path to loaction of file as you figured out so you need to add value of your extra field as weel.
{$entry->file_location}/{$entry->fieldsbyname.upload->value}
sam_m
Forum Members
Forum Members
Posts: 34
Joined: Thu Jun 11, 2009 11:59 pm

Re: Linking to a file uploaded from CGBlog summary page

Post by sam_m »

uniqu3 wrote:{$entry->file_location} is only path to loaction of file as you figured out so you need to add value of your extra field as weel.
{$entry->file_location}/{$entry->fieldsbyname.upload->value}
Amazing!!! such a quick reply, thank you for much for your help, thats spot on :)

Kind Regards
Sam
Post Reply

Return to “Modules/Add-Ons”