5121 Posts in 1527 Topics by 1119 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 560 Views |
-
Download image in Model Admin

2 June 2011 at 12:39pm
Hey guys, I am using ModelAdmin to view orders in a system and I want the option for once you click on an order to view/download the full size image attached to the order. Currently you can upload a file, but you can't download the exist file attached. How would I go about achieving this ?
-
Re: Download image in Model Admin

2 June 2011 at 8:36pm
Hi,
I temporarily hacked my system for this...
sapphire\templates\FileIFrameField.ssyou can probably put this in you mysite templates folder to override it without affecting the "core"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" >
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<% base_tag %><title><% _t('TITLE', 'Image Uploading Iframe') %></title>
</head><body>
<div class="mainblock editform">
$EditFileForm
</div><% if AttachedFile %>
<div class="mainblock">
<!-- start hack -->
<a href="$AttachedFile.Link" target="_new">$Name</a>
<!-- end hack -->
$AttachedFile.CMSThumbnail<% if DeleteFileForm %>
$DeleteFileForm
<% end_if %>
</div>
<% end_if %>
</body></html>
-
Re: Download image in Model Admin

5 June 2011 at 8:17pm
Thanks for that! Worked a treat. It's good to know how simple it is to change core functionality of the framework.
| 560 Views | ||
|
Page:
1
|
Go to Top |


