Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Images


Reply

2 Posts   921 Views

Avatar
corkg

6 July 2008 at 12:16am (Last edited: 6 July 2008 12:25am), Community Member, 30 Posts

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)

Avatar
dio5

6 July 2008 at 10:19am Community Member, 501 Posts

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

$Image.URL