Sonya* Posted January 8, 2020 Share Posted January 8, 2020 I have created a custom field in database of type Upload (Allow multiple). I would like to display uploaded images in the Lightbox widget. In the description of Display custom field is stated: If using mulitple uploads, $value is an array of File Objects. However it seems to be an array of strings and not File Objects, as this code fails: Error: Call to a member function thumbnail() on string (0) Link to comment Share on other sites More sharing options...
TheJackal84 Posted January 9, 2020 Share Posted January 9, 2020 Try loading the file $image = \IPS\File::get( 'theStorageLocation', $value ); Then $image->url etc etc Link to comment Share on other sites More sharing options...
Sonya* Posted January 9, 2020 Author Share Posted January 9, 2020 1 minute ago, TheJackal84 said: Try loading the file $image = \IPS\File::get( 'theStorageLocation', $value ); I've already done. This is just a kind of "bug" submission that docs in description is wrong. 😉 Link to comment Share on other sites More sharing options...
Daniel F Posted January 9, 2020 Share Posted January 9, 2020 The upload field is behaving different within pages, please see ( just mentioning it here for the people which find this topic via the search ) I guess we could and should update the description 🙂 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.