Jump to:

22972 Posts in 11596 Topics by 2824 members

General Questions

SilverStripe Forums » General Questions » Can't see Einstein photo from tutorial 2 but in CMS it is there

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

Page: 1
Go to End
Author Topic: 525 Views
  • suntrop
    Avatar
    Community Member
    131 Posts

    Can't see Einstein photo from tutorial 2 but in CMS it is there Link to this post

    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.

  • suntrop
    Avatar
    Community Member
    131 Posts

    Re: Can't see Einstein photo from tutorial 2 but in CMS it is there Link to this post

    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.

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