Jump to:

3431 Posts in 1058 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Setting an upload to folder

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

Page: 1 2
Go to End
Author Topic: 2481 Views
  • tsg
    Avatar
    Community Member
    7 Posts

    Re: Setting an upload to folder Link to this post

    You would need to use $this->URLSegment within your class rather than just $URLSegment which you'd use in a template.

    e.g.

    $fields->addFieldToTab('Root.Content.Image', new ImageField('Image', 'Image', null, null, null, 'assets/News/' . $this->URLsegment));

    cheers
    tsg

    2481 Views
Page: 1 2
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.