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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Can't view uploaded Image

Go to End

4 Posts   1496 Views


31 Posts

31 August 2009 at 6:54am

Hi All.

I'm having a problem with my images, hopefully someone can help.

I added the following in my page.php file under the "class Page extends SiteTree":

public static $has_one = array( 'Banner' => 'Image' );

function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Banner", new ImageField('Banner'));
return $fields;

The banner image uploads, but no picture. When I look at the source html it shows: <img src="/assets/" alt="assets/" />

What am I doing wrong?


Forum Moderator, 5523 Posts

31 August 2009 at 9:03am

Have you rebuilt your database ( to add the new fields for the image?. Next thing you can check is if you go into your database (with phpmyadmin or similar) and you select the 'Page' table you should see a BannerID column. Check this value - if your upload worked then this should not be 0.


31 Posts

1 September 2009 at 11:17am

Hi Willr,

I figured it out. I has a .ss file from a previous project that was interfering with the link. Sorry for wasting your time and many thanks for the quick response and help.


Mr V Dot

Community Member, 8 Posts

9 November 2009 at 4:28am

Edited: 09/11/2009 4:28am

Todd, what exactly was in the template file that was messing up your link? I'm having the same problem, but only have one main template ( and as far as I can tell not even removing my includes fixes the issue. Thanks