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 see Einstein photo from tutorial 2 but in CMS it is there


Go to End


2 Posts   820 Views

Avatar
suntrop

Community Member, 141 Posts

29 March 2010 at 1:35am

I followed tutorial 2 and uploaded a photo of Einstein but I can't see it on the public site. The DIV is just empty <div class="staffphoto"></div>
In CMS view I can see it (in the article and in the asset folder).

The only change I made is to rename photo to Foto.
In StaffPage.ss
$Foto.SetWidth(150)

In StaffPage.php
static $has_one = array(
'Foto' => 'Image'
);
… and
$fields->addFieldToTab("Root.Content.Bilder", new ImageField('Foto'));

I flushed the pages more than once, but no image. Neither in the staff holder page nor in the staff page.

Avatar
suntrop

Community Member, 141 Posts

29 March 2010 at 2:01am

I got it. After a look in the DB I saw that the relation to the photo wasn't in the live version. I saved and published the page and it gets displayed.
I thought uploading the picture is sufficient and didn't know to publish the article again.