Jump to content

gebeer

Members
  • Content Count

    996
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by gebeer

  1. I had that problem, too. Until I discovered that my PHP gd library didn't have webp support installed. So you need to check that in phpinfo. I am using laradock for my local dev environment. In my php-fpm container, I had to install libwebp-dev. For my specific environment this was achieved with RUN apt-get update -yqq && \ apt-get install -y libwebp-dev RUN docker-php-ext-configure gd \ --enable-gd-native-ttf \ --with-jpeg-dir=/usr/lib \ --with-webp-dir=/usr/lib \ --with-freetype-dir=/usr/include/freetype2 && \ docker-php-ext-install gd
  2. I will soon implement the file upload to custom folder feature into ImageReference. Then you can upload an image from within the inputfield to a designated folder and then pick it afterwards. This should make it an even better option for SettingsFactory.
  3. Happy New Year to everybody! New v.2.0.1 is out. It fixes the problem described by @LMD. Now the inputfield can be used inside repeaters again. Also I removed the option to load thumbnails via ajax. It didn't really make sense to have this as an option. They are now always loaded via xhr requests. I did extensive testing with 2 fields of this type on one template and a repeater field on the same template, that also holds the 2 fields of this type and it went smoothly. However, if you experience any problems, please let me know here or on github. Thank you.
  4. Do you need a fallback code in a template php file to render your normal image field if imagereference field is empty? an empty ImageReference field returns null. So you could do something like this if($page->imagereference) { // the image reference field has an image echo "<img src='$page->imagereference->url'>"; } elseif(!$page->imagereference && $page->imagenormal) { // no image in image reference field but image in normal image field echo "<img src='$page->imagenormal->url'>"; } You can have the ImageReference field alongside your normal image field on one template. So it shouldn't be a problem to keep your normal images field and add a ImageReference field. The ImageReferenceField needs a normal image field to get images from. But the normal image field does not have to be on the same page since you can pick an image from any other page (depending on the field settings). Hope this clarifies it. If not, please try to explain your use case in more detail.
  5. @LMD thank you for reporting. Will look into it and upload a patch soon.
  6. Not quite sure if I really understand your needs. If you want to upload a file from a URL to a file field, there is a module 'Add Image URLs'. Maybe you can use it, or some code from that module for your file field.
  7. New v2.0.0 is out on github. I renamed the module to ImageReference (as suggested by @bernhard) to avoid the naming conflict with @theo's module ImagePicker. Version was bumped to 2.0.0 because it introduces breaking changes due to renaming. So if you have an older version installed, you need to first uninstall it and then install v2.0.0. Sorry for the inconvenience. The new version also adds a new option. You can now choose images from any page on your site (similar behavior to choosing images when inserting into CKEditor). Please give it a try and let me know if you run into any problems. After some more revision, I will add this fieldtype to the modules directory. I would like to thank everybody who contributed their ideas to this module and wish everyone a good transition into the new year.
  8. Nice idea. If you have sth like template engine factory module in mind, people could add their own engine modules. Two more engines, that are quite popular and not on your list: Mustache and Smarty.
  9. Thanks a lot for your suggestions @szabesz @bernhard I really like ImageSorcerer and ImageReference. The former for its creativity, the latter for its clarity and reference to the page reference field. The more I think about it the more I tend towards ImageReference. It says it all clear what this fieldtype and inputfield are doing: allowing you to store a reference to an image that lives elsewhere in the system. I had that thought, too. But I decided to leave them as separate options mainly because the 'select image from page' allows to setup a dedicated page with a set of images to choose from and to categorize them by using child pages. If I made this a flexible option it might not be obvious for developers and editors what is really happening here. What I'm currently working on is having the PageListSelect remember the page that the image was selected from. Will release this feature before end of this year.
  10. @kongondo let me know that there already is a fieldtype module ImagePicker authored by @theo. To avoid confusion, I am going to rename my module. Not 100% sure yet on the new name. What I think would fit the purpose and features of my module is ImageFromAnywhere. With the upcoming addition of the 'Choose image from any page' feature, I think this name reflects quite well what the module does. I'll be happy to receive your suggestions for a new name. Note to forum admins: I can't make text bold or italic for quite some time now on latest Firefox and Chrome on Linux.
  11. I am working on the 'pick image from any page' feature. It have it basically working but it still needs some polishing. Here's a short preview (mainly for @adrian) so you see what I mean 😉 pickfromanypage.mp4
  12. Thank you for this info. I was not aware of that. Will have a loock at that module and contact the author. Can rename mine if necessary because eventually I want to add it to the directory.
  13. You can also use a conditional hook https://processwire.com/blog/posts/new-ajax-driven-inputs-conditional-hooks-template-family-settings-and-more/#new-conditional-hooks These fire only, when a specified field value has changed. So your potential problem of accidentally sending multiple emails can be eliminated. You just watch for changes in your status field and act accordingly. Edit: here is an excellent tutorial about how to watch for field changes: It uses a different hook.
  14. Thanks for posting the solution to your problem! To test if a full page object was returned by $pages->get() you can use if($category->id) {...} This is usually enough. When PW doesn't find a page it returns an object NullPage. This NullPage object returns null for id. So the simple test above is sufficient. Since you get your category and subcategory names from the urlSegments, you could test earlier in your code if these exist. If there is no urlSegment(1), $categoryName = $sanitizer->pageName($input->urlSegment(1)); will return an empty string. So you could test for that. I can recommend to start early on using the fabulous debugger module TracyDebugger. It makes dev life easier and can save a lot of time. I use it on every project. Also it is always goo to have the API reference open in a separate tab or browser window 🙂
  15. Hello and welcome to the forum! Glad you figured it out. Would be nice if you could also share what the problem was, so that others can learn from it. Was it this line?
  16. Media Library uses pW image fields behind the scene. So in Setup->Fields you can search for the field which has the label 'MediaImages'. In the field settings, you can add 'svg' to the allowed file types. That should do the trick.
  17. I'm not talking about the field settings. I mean the inputfield itself. Where you have all the options 'Choose an Image from...'. There will be a new option 'Choose an image from any page' This one will give you a PagelistSelect. After selecting a page you will be presented with thumbnails of all images from that page and can pick one. Clear now? Edit: The screenshot in your post is not from my inputfield, right?
  18. Updated the field settings. Before you had to choose the image fields both for the page you defined and for the optional edit page. I unified these into one setting. Images will be pulled from these fields for all relevant pages (if one of the fields exists on a page)
  19. This is the way that InputfieldMarkup behaves inside an InputfieldWrapper. At least in my case. I amended it with some custom CSS. It's in the new master. ATM it only shows thumbnails for the page you define in the settings (and its children). What I mean, is a new option that allows you to pick images from any page on the site. So there would be an InputFieldPagelistSelect to select a page. Once selected, you get thumbnails for that page and can pick one. Just like in the pwimage plugin for CKEditor
  20. I also came from Joomla and was so happy to discover ProcessWire. It was a game changer for me. The good thing about PW is, that you can have all these things on demand as modules. So it is up to the developer to choose features they want to include on a site.
  21. New v1.1.3 is out. Following @adrian's request, in the field settings you can now choose multiple image fields to get images from. The tooltips on the thumbnails and the info below the preview image show the field name that this image belongs to.
  22. Just an idea: when you insert images into CKEditor with the pwimages plugin, you can choose an image from the page you are on but also from any other page of the site. Do you think this could be a useful feature for ImagePicker?
×
×
  • Create New...