Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » is it possible to add a image field to a redirector page type

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

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

Page: 1
Go to End
Author Topic: 900 Views
  • lubzee
    Avatar
    Community Member
    15 Posts

    is it possible to add a image field to a redirector page type Link to this post

    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 {
       
    }

    900 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.