Add Images programmatically in Backend

This topic contains 1 reply, has 2 voices, and was last updated by  Stiofan O’Connor 6 years, 9 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #396725

    Thommy Cesar
    Expired Member
    Post count: 2

    Hello,

    I’m about to write a GooglePlaces Importer. When adding a place in the backend, a MetaBox is displayed with an Autocomplete field that searches Google Places. As soon as I select a location, the fields are filled out automatically. It’ll be all right.

    The image URLs are in an array. But I can’t manage to add the pictures with upload.
    Do you have any advice for me?

    My Array with the URLs:

    
    
    
    data2['photos'] = new Array;
    for (i = 0; i < place.photos.length; i++) {
       data2['photos'][i] = place.photos[i].getUrl({'maxWidth': 1200, 'maxHeight': 1200});
    }
    

    I already tried this, but it didn’t worked out:

    
    
    
    jQuery('#post_images').val(data2['photos']);plu_show_thumbs('post_images');
    

    Is there any other Trick to make it run?

    #396745

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Thommy,

    If i remember correctly all u have to do is update the value of #post_images input with a comma separated list of image url’s, if they are external images they will be imported.

    We did look at doing something like this but it was against the Google T&C’s.

    Thanks,

    Stiofan

Viewing 2 posts - 1 through 2 (of 2 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket