/ Published in: PHP
For us when want to add an image to silverstrip
Expand |
Embed | Plain Text
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 %>
Comments
Subscribe to comments
You need to login to post a comment.

am I the only who sees the uselessness of this code as a stand-alone snippet?
it's useful to me and someone working with silverstrip.
you should document that in your description :P
"For use in %blah% when you want to %blah"