Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

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

    Images Link to this post

    Hi

    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
    Avatar
    Community Member
    501 Posts

    Re: Images Link to this post

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

    $Image.URL

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