Return to Snippet

Revision: 14366
at June 3, 2009 20:02 by petterdr


Updated Code
static $has_one = array(
   'BannerImage' => 'Image'
 );


function getCMSFields() {
  $fields = parent::getCMSFields();
  $fields->addFieldToTab("Root.MyBannerImage", new ImageField("BannerImage"));
  return $fields;
}

//TEMPLATE
  <% control BannerImage %>
              <% control ResizedImage(150,100) %>
               <img src="$URL" alt="" width="150px" height"100px" />
              <% end_control %>
             <% end_control %>

Revision: 14365
at June 1, 2009 20:15 by petterdr


Initial Code
static $has_one = array(
   'BannerImage' => 'Image'
 );


function getCMSFields() {
  $fields = parent::getCMSFields();
  $fields->addFieldToTab("Root.MyBannerImage", new ImageField("BannerImage"));
  return $fields;
}

Initial URL


Initial Description
For us when want to add an image to silverstrip

Initial Title
Image in Silverstrip

Initial Tags


Initial Language
PHP