Jump to:

23552 Posts in 19349 Topics by 2891 members

General Questions

SilverStripe Forums » General Questions » Pre-populate ImageField by ID

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: 867 Views
  • DeklinKelly
    Community Member
    197 Posts

    Pre-populate ImageField by ID Link to this post

    I want to allow certain registered users the ability to upload images from the front-end of SilverStripe as well as browse the file store for images.

    How can I pre-populate the ImageField with the image with an ID of 5? This does NOT work:

    new ImageField('TeaserImage', 'Teaser Image',5),

    I get this message: "Images can be attached once you have saved the record for the first time."

    I cannot use SimpleImageField because I want users to be able to browse the file store as well as upload images.

  • Ryan M.
    Community Member
    309 Posts

    Re: Pre-populate ImageField by ID Link to this post

    My advice would be to install Uploadify and use its ImageUploadField. It includes tabs to either upload new or select existing from file store.

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.