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.

Archive /

Our old forums are still available as a read-only archive.

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

is it possible to add a image field to a redirector page type


Go to End


1628 Views

Avatar
lubzee

Community Member, 15 Posts

7 October 2008 at 10:42pm

I get an error when I create a page with the following model/controller setup.
Is something like this possible?

class LinkHolder extends RedirectorPage {
	static $db = array(
	);
	static $has_one = array(
		'Photo' => 'Image'
	);
	
	function getCMSFields() {
		$fields = parent::getCMSFields();
		
		$fields->addFieldToTab("Root.Content.Images", new ImageField('Photo'));
   	
		return $fields;
	}
}
 
class LinkHolder_Controller extends RedirectorPage_Controller {
	
}