Macrura Posted December 13, 2019 Share Posted December 13, 2019 cool! Image picking has been an issue with SettingsFactory... so this will be great ?. I'll check it out and do some testing asap! 2 Link to comment Share on other sites More sharing options...
adrian Posted December 13, 2019 Share Posted December 13, 2019 @gebeer - that all sounds brilliant - thanks again so much for this - it's going to be an awesome solution! Link to comment Share on other sites More sharing options...
gebeer Posted December 14, 2019 Author Share Posted December 14, 2019 11 hours ago, Macrura said: cool! Image picking has been an issue with SettingsFactory... so this will be great ?. I'll check it out and do some testing asap! If you want to test it, you will have to use the branch jsonvalue from github. 2 Link to comment Share on other sites More sharing options...
gebeer Posted December 16, 2019 Author Share Posted December 16, 2019 I have made good progress and have a working version now, that allows to pick an image from a predefined page (and optionally its children), a folder inside site/templates or the page that is being edited. The version is available in the branch 'allinone' on github. Install from URL https://github.com/gebeer/FieldtypeImageFromPage/archive/allinone.zip If you find the time, please do some testing and report your findings. Thank you. If you test, please uninstall previous versions and install this one.EDIT: Also uninstall InputfieldImagePicker if you happened to install it. My code does not cater fully for DB update, yet. And since I switched field value storage to json, atm this has to be installed from scratch. The module is still on that repository. But eventually I will publish it on the ImagePicker repository when I feel it is ready. One thing I still have to solve: ATM the field returns 2 different objects for rendering in templates, depending on where the image comes from. If it comes from a page, you will get a Pageimage object. If it comes from a folder inside site/templates, you will get a custom ImagePickerFile object. The latter one cannot be manipulated (resizing/cropping) like a Pageimage but has some similar properties. I still have to find a way how to turn images from a folder that is not connected to a page into Pagimage objects. This is quite tricky. I wonder if anyone who is reading this has evr tried to accomplish something similar. I really always want to provide a Pageimage object, no matter where the real image file lives so that it can be manipulated. Still scratching my head on that but hope I will find a solution. 3 Link to comment Share on other sites More sharing options...
adrian Posted December 16, 2019 Share Posted December 16, 2019 Really short on time, but wanted to take a quick look. So far looks really great - thank you! I noticed this error - only occurs if the child page doesn't have images available. Also, I am wondering about the radio buttons as a way to choose the fields that images can come from. I would have thought checkboxes were better to allow for multiple fields. This may be for multiple fields on the one page/template, but I can see it also being useful for different pages with different templates that have different image fields. Does that make sense? 1 Link to comment Share on other sites More sharing options...
gebeer Posted December 16, 2019 Author Share Posted December 16, 2019 21 minutes ago, adrian said: I noticed this error - only occurs if the child page doesn't have images available. Thanks for reporting. 21 minutes ago, adrian said: Also, I am wondering about the radio buttons as a way to choose the fields that images can come from. I would have thought checkboxes were better to allow for multiple fields. I was thinking about that one, too. But then I decided to allow only one images field because it might confuse users. But then, if I allowed multiple fields, the user could upload to any images field and have them available for the picker. Think, finally I will add this. 1 Link to comment Share on other sites More sharing options...
gebeer Posted December 16, 2019 Author Share Posted December 16, 2019 28 minutes ago, adrian said: I noticed this error - only occurs if the child page doesn't have images available. regarding that error. Do you also have my module ImagePicker installed on that site? Link to comment Share on other sites More sharing options...
adrian Posted December 16, 2019 Share Posted December 16, 2019 31 minutes ago, gebeer said: regarding that error. Do you also have my module ImagePicker installed on that site? Yeah, I did. I just uninstalled it and that error is now gone, but I am now seeing: and having real problems getting rid of it. Link to comment Share on other sites More sharing options...
gebeer Posted December 16, 2019 Author Share Posted December 16, 2019 3 minutes ago, adrian said: Yeah, I did. I just uninstalled it and that error is now gone, but I am now seeing: and having real problems getting rid of it. Sorry for that one. InputfieldImagePicker did not manipulate any other image fields. Was your field 'image' created from InputfieldImagePicker? If so, you need to remove it and the error should be gone Link to comment Share on other sites More sharing options...
adrian Posted December 16, 2019 Share Posted December 16, 2019 It wasn't created that way - just a regular image field. Even after deleting it I am still seeing the error - will have to dive deeper to see where it's originating. Link to comment Share on other sites More sharing options...
gebeer Posted December 16, 2019 Author Share Posted December 16, 2019 3 minutes ago, adrian said: It wasn't created that way - just a regular image field. Even after deleting it I am still seeing the error - will have to dive deeper to see where it's originating. Really sorry for the trouble. Maybe caching issue? The 2 modules were never supposed to be installed alongside each other and I didn't take that into account since it is planned to replace the 'old' ImagePicker module with this one. Added a warning to my post above so others won't fall into that pit. 1 Link to comment Share on other sites More sharing options...
adrian Posted December 16, 2019 Share Posted December 16, 2019 Not your fault at all - took me a while, but turns out it was my definition of a field in SettingsFactory that was causing the problem ? All sorted now and the new version works great for Settings Factory as well - really cool - I especially love the ability to upload directly via that field and it automatically reloads the available images after closing the modal. Link to comment Share on other sites More sharing options...
adrian Posted December 16, 2019 Share Posted December 16, 2019 One small thing - note the wrapping of the filename which I think should be fixed. Link to comment Share on other sites More sharing options...
gebeer Posted December 16, 2019 Author Share Posted December 16, 2019 3 minutes ago, adrian said: All sorted now Glad you sorted it! 1 minute ago, adrian said: One small thing - note the wrapping of the filename which I think should be fixed This is on purpose. Otherwise the filename would overflow the background area, especially on not so wide previews. Doesn't look very nice as it is, I know. In the CSS I had hyphens: auto; before but that would break the filename to the next line too soon. So I decided to go for word-wrap: break-word; instead. 1 Link to comment Share on other sites More sharing options...
eydun Posted December 17, 2019 Share Posted December 17, 2019 I finally tested the branch version, and it works great! ? 1 Link to comment Share on other sites More sharing options...
eydun Posted December 17, 2019 Share Posted December 17, 2019 One minor thing: when I choose to use "from-folder" as image-source, then it is not possible to upload new images into the folder within ImagePicker. Is this planned behavior, or can it be solved? Thanks. This upload-icon is missing, when picking image from folder. Link to comment Share on other sites More sharing options...
gebeer Posted December 18, 2019 Author Share Posted December 18, 2019 3 hours ago, eydun said: I finally tested the branch version, and it works great! Thank you for testing! 2 hours ago, eydun said: One minor thing: when I choose to use "from-folder" as image-source, then it is not possible to upload new images into the folder within ImagePicker. Is this planned behavior, or can it be solved? Thanks. This is intended behaviour at the moment. But I am planning on incorporating an upload widget for the folder images, too. For uploading the page images the module uses the standard PW page edit feature. But since folder images are not linked to a page (at least not yet in the current version), I need to use a different solution here. I like https://uppy.io/ a lot and think I will implement it for managing images in the folder. I have merged all the features of this module into my ImagePicker module and will release a new version of that this week. 2 Link to comment Share on other sites More sharing options...
gebeer Posted December 18, 2019 Author Share Posted December 18, 2019 It is done. I have merged this module with the ImagePicker module. Now it includes almost all requested features. It is published as FieldtypeImagepicker on github. I will update the ImagePicker thread shortly and continue discussion there. Hope to see you! 4 2 Link to comment Share on other sites More sharing options...
szabesz Posted December 18, 2019 Share Posted December 18, 2019 Thank you! It makes a great Christmas present for the community! I haven't had time to do further testings but I will surely try out the new module during this holiday season. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now