Jump to:

3373 Posts in 999 Topics by 712 members

Data Model Questions

SilverStripe Forums » Data Model Questions » grabbing logos from URL and adding with imagefield?

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

Page: 1
Go to End
Author Topic: 1076 Views
  • danzzz
    Avatar
    Community Member
    175 Posts

    grabbing logos from URL and adding with imagefield? Link to this post

    hi

    I have a dataobject with this relation:

    static $has_one = array(
    'logo' => 'Image',
    );

    So with this I can add a logo in the backend ...
    In my case I would download the logo from an other site an upload it on my site ...

    But how it's possible to add a logo automaticly if I know the URL to the image -> dowload the logo and add it with imagefield?

    I think it's easyier to not use an imagefield in this case and just link to the logo URL, right?

    thx

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: grabbing logos from URL and adding with imagefield? Link to this post

    weeelllll - you can always just insert HTML into your content to do the sort of thing you are asking.

    the real benifit of uploading it to silverstripe assest (which is what that does) is that the image can be manipulated (into thumbnail, or cropped, etc) and is then stored in resampled (a "cache") which greatly speeds up page load - at the same time as giving your users more "simple" control over these things. A nice thing of SS3 I am looking forward to is versioned assests - out of the box - but it'll only be with using the technology not taking "shortcuts".

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