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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

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

Setting an upload to folder


Go to End


9 Posts   4592 Views

Avatar
tsg

Community Member, 7 Posts

9 December 2009 at 7:12pm

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

Go to Top