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.

General Questions /

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

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

Can't see Einstein photo from tutorial 2 but in CMS it is there


Reply


2 Posts   641 Views

Avatar
suntrop

Community Member, 131 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, 131 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.