Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » Images

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: 904 Views
  • corkg
    Community Member
    30 Posts

    Images Link to this post


    At the moment I am adding images like this:

       static $has_one = array(
    'Image' => 'Image',
    'ImageThumb' => 'Image'
    function getCMSFields() {
    $fields = parent::getCMSFields();
    $fields->addFieldToTab('Root.Content.Main', new ImageField('Image'), 'Content');
    $fields->addFieldToTab('Root.Content.Main', new ImageField('ImageThumb'), 'Content');
    return $fields;

    which is the way described in the tutorial: extending a basic site,

    but i don't want the cms to make the image code (<img src="test.gif" alt="" />)i only want to see the link when i call for it (test.gif)

  • dio5
    Community Member
    501 Posts

    Re: Images Link to this post

    instead of doing $Image in yr template, you can do


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.