Make image field also link to filemanager?

Permalink Browser Info Environment
Hi
Is there any way to make the image field link to the filemanager, I can see that it links to the sitemap and a url but I think it would be useful if it also linked to the filemanager. I am working on a site that has PDF brochure downloads and the client wants small images of the brochure covers that download the PDFs when clicked.

Regards
Karl

Type: Discussion
Status: New
oakleafg
View Replies: View Best Answer
jordanlev replied on at Permalink Best Answer Reply
jordanlev
What I'd do is create the block with both an image field and a file download field. The user will edit these two fields separately when adding/editing the block, but then when the block is displayed you can combine the two into one link (which means you'll need to edit the view.php file after the block is generated).

Are you a php programmer at all? If so, this should be fairly easy to figure out, but if not you'll need to create the block, then ZIP the block code (it will be a folder that has the name of the "block handle" you provided when making it, inside your site's "blocks" directory) and post it here in the forum so I can make the change for you. However, please note that I am *extremely* limited on time right now, so I am happy to help out with this but cannot guarantee any kind of timely response (sorry about this).

If time is a factor and I can't respond soon, you might want to try asking the question in the general C5 forums, pointing them to this post I have here so they know what we're talking about.

-Jordan
oakleafg replied on at Permalink Reply
oakleafg
Worked a treat thanks.
Here is the code if anybody wants to use it as a 'guide' (obviously don't just use it as it stands as some of the items will be different) but it shows the structure.

<?php  if (!empty($field_2_image)): ?>
   <div id="downloadsimg">
   <a href="<?php  echo View::url('/download_file', $field_4_file_fID, Page::getCurrentPage()->getCollectionID()); ?>" class="file-<?php  echo $field_4_file->getExtension(); ?>">
      <img src="<?php  echo $field_2_image->src; ?>" width="<?php  echo $field_2_image->width; ?>" height="<?php  echo $field_2_image->height; ?>" alt="" /></a>
   </div>

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.