Posted By

petterdr on 06/01/09


Tagged

ss silverstrip


Versions (?)

Image in Silverstrip


 / Published in: PHP
 

For us when want to add an image to silverstrip

  1. static $has_one = array(
  2. 'BannerImage' => 'Image'
  3. );
  4.  
  5.  
  6. function getCMSFields() {
  7. $fields = parent::getCMSFields();
  8. $fields->addFieldToTab("Root.MyBannerImage", new ImageField("BannerImage"));
  9. return $fields;
  10. }
  11.  
  12. //TEMPLATE
  13. <% control BannerImage %>
  14. <% control ResizedImage(150,100) %>
  15. <img src="$URL" alt="" width="150px" height"100px" />
  16. <% end_control %>
  17. <% end_control %>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: MMDeveloper on June 3, 2009

am I the only who sees the uselessness of this code as a stand-alone snippet?

Posted By: petterdr on June 3, 2009

it's useful to me and someone working with silverstrip.

Posted By: MMDeveloper on June 4, 2009

you should document that in your description :P

"For use in %blah% when you want to %blah"

You need to login to post a comment.