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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Proper Download URL


Go to End


4 Posts   992 Views

Avatar
SSTN

Community Member, 9 Posts

8 September 2010 at 1:48pm

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

Forum Moderator, 4102 Posts

8 September 2010 at 1:55pm

$YourFile.URL

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

Avatar
SSTN

Community Member, 9 Posts

8 September 2010 at 2:39pm

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

Forum Moderator, 4102 Posts

8 September 2010 at 3:21pm

$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