21279 Posts in 5729 Topics by 2600 members
| Go to End | ||
| Author | Topic: | 1653 Views |
-
Re: [solved] force file download

30 September 2011 at 3:07am
Okay I think I'm starting to understand what you're trying to do. The way you have it structured you're passing download as a variable to the link method. What you want to do is create a urls that calls the page/action/id method. So it should be
<a href="{$Top.Link}/download/{$SongFile.ID}" title="$Title.XML">Download</a>
so the url is structured: url of page / method you want to call / id you want to pass
Hope that helps
-
Re: [solved] force file download

30 September 2011 at 3:18am Last edited: 30 September 2011 3:22am
Sorry for the confusion, but the code i posted is actualy working.
$Link is a method in the SiteTree model and it takes an $action optional parameter, hence the $Top.Link(download).
Here's a link to the API documentation http://api.silverstripe.org/2.4/cms/SiteTree.html#methodLink
| 1653 Views | ||
| Go to Top |


