Jump to:

10997 Posts in 2731 Topics by 1822 members

All other Modules

SilverStripe Forums » All other Modules » User forms - links to uploaded files

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1255 Views
  • justinv
    Avatar
    Community Member
    8 Posts

    User forms - links to uploaded files Link to this post

    Hi, I've been using user forms. I've got a file upload form and want to put links to all uploaded files on the same page as the form.

    Can anyone help?

    Thanks

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: User forms - links to uploaded files Link to this post

    Are you talking about putting links to the files on the front end of the site rather than the CMS?.

    You would need to write your own function to get the files and then some template code to display it. So the function to get the uploaded files would look like

    // note will only work for UDF 0.3
    function getUserformsUploads() {
    return DataObject::get('SubmittedFileField');
    }

    Then in your template file you would loop over that to output the uploads.

    <% control UserformsUploads %>
    $FormattedValue
    <% end_control %>

  • justinv
    Avatar
    Community Member
    8 Posts

    Re: User forms - links to uploaded files Link to this post

    Yes that's what I was looking for.

    Thanks, much appreciated.

    1255 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.