Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Proper Download URL


Reply

4 Posts   723 Views

Avatar
SSTN

8 September 2010 at 1:48pm Community Member, 9 Posts

Just wondering what the proper ss code is to create a relative download link.

ie: <a href="&BaseHref/&Name">Click Here to Download<a/> or something similar.

Avatar
UncleCheese

8 September 2010 at 1:55pm 4085 Posts

$YourFile.URL

---------------
Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com

Avatar
SSTN

8 September 2010 at 2:39pm Community Member, 9 Posts

Awesome, thanks. Let's just pretend I'm really stupid for a second.

<% control Resources %>
<p>
<hr />
<b>&quot;$Name&quot;</b>
<hr />
<% control Attachment %>$Player(640,480)<% end_control %><br />
<i>$Description</i><br>
</p>
<% end_control %>

I want to insert a link into this control set to download the posted mp3's.
How does $YourFile.URL work in this instance?

Where should I look for this kinda info?

Avatar
UncleCheese

8 September 2010 at 3:21pm 4085 Posts

$Attachment.URL.. "YourFile" is just a placeholder name of the file relationship you've created.

---------------
Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com