Forums / General / simple Download Link???
Tim Achnitz
Monday 22 September 2003 5:47:43 am
Hi,
I've a class with a Datatype BinaryFile. How does a "download-link" look like? ( {attribute_view_ ....} ???)
thx
Tuesday 23 September 2003 12:25:33 am
I turned on the Template Debugging in the Backend and found out, that there is this ezbinaryfile.tpl but I don't know how to use it. Maybe you know?
James Packham
Tuesday 23 September 2003 3:35:13 am
I can only partially answer this because I'm having my own troubles with this feature :)
I used the little magnifying glass icon under "related objects" area (to the right of the screen whilst creating/editing files) to find the object (file). When you click ok you are left with a little bit of detail about the object, it's name, object ID and link location.
Copy and paste the link location into the xml format for a link and change it to normal (non admin) location (assuming you're using uri like me) so you get something like:
<link class='file' href='http://192.168.0.1/news/content/view/full/59'>here</link>
Congratulations, now you should have something that doesn't work but looks a lot better than an error message. But don't feel bad, this is as far as I've managed to get too ;)
Please let me know if you figure out what to do next! I will do likewise! Sorry I couldn't be more help!
~James~
Bjørn Kaarstein
Wednesday 24 September 2003 2:38:47 am
do the fetching...
then....
{node_view_gui view=full content_node=$Child:item}
Put this in the ezbinaryfile.tpl
a href={concat("content/download/",$attribute.contentobject_id,"/",$attribute.id,"/file/",$attribute.content.original_filename)|ezurl}>{$attribute.content.original_filename|wash(xhtml)}</a> <td align="right">{$attribute.content.filesize|si(byte)}</td>
Regards Bjørn