Jump to content
gebeer

FieldtypeImageFromPage pick an image from various sources

Recommended Posts

cool! Image picking has been an issue with SettingsFactory... so this will be great 😀. I'll check it out and do some testing asap!

  • Like 2

Share this post


Link to post
Share on other sites

@gebeer - that all sounds brilliant - thanks again so much for this - it's going to be an awesome solution!

Share this post


Link to post
Share on other sites
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.

  • Like 2

Share this post


Link to post
Share on other sites

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.

  • Like 3

Share this post


Link to post
Share on other sites

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.

image.png.c2c6e93be7b599aa5a3c65c11ed7fd51.png

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?

 

  • Like 1

Share this post


Link to post
Share on other sites
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.

  • Like 1

Share this post


Link to post
Share on other sites

 

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?

Share this post


Link to post
Share on other sites
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: 
image.png.79b5d789777719cecb0d72ec0474fb0c.png

and having real problems getting rid of it.

Share this post


Link to post
Share on other sites
3 minutes ago, adrian said:

Yeah, I did. I just uninstalled it and that error is now gone, but I am now seeing: 
image.png.79b5d789777719cecb0d72ec0474fb0c.png

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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.

  • Like 1

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

One small thing - note the wrapping of the filename which I think should be fixed.

image.png.be45e6c854415fb1e2d8c80d14660c0e.png

Share this post


Link to post
Share on other sites
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.

  • Like 1

Share this post


Link to post
Share on other sites

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.

billede
This upload-icon is missing, when picking image from folder.

Share this post


Link to post
Share on other sites
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.

  • Like 2

Share this post


Link to post
Share on other sites

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.

  • Like 2

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MoritzLost
      Process Cache Control
      This module provides a simple solution to clearing all your cache layers at once, and an extensible interface to perform various cache-related actions.
      The simple motivation behind this module was that I was tired of manually clearing caches in several places after deploying a change on a live site. The basic purpose of this module is a simple Clear all caches link in the Setup menu which clears out all caches, no matter where they hide. You can customize what exactly the module does through it's configuration menu:
      Expire or delete all cache entries in the database, or selectively clear caches by namespace ($cache API) Clear the the template render cache. Clear out specific folders inside your site's cache directory (/site/assets/cache) Clear the ProCache page render cache (if your site is using ProCache) Refresh version strings for static assets to bust client-side browser caches (this requires some setup, see the full documentation for details). This is the basic function of the module. However, you can also add different cache management action through the API and execute them through the module's interface. For this advanced usage, the module provides:
      An interface to see all available cache actions and execute them. A system log and logging output on the module page to see verify what the module is doing. A CacheControlTools class with utility functions to clear out different caches. An API to add cache actions, execute them programmatically and even modify the default action. Permission management, allowing you granular control over which user roles can execute which actions. The complete documentation can be found in the module's README.
      Plans for improvements
      If there is some interest in this, I plan to expand this to a more general cache management solution. I particular, I would like to add additional cache actions. Some ideas that came to mind:
      Warming up the template render cache for publicly accessible pages. Removing all active user sessions. Let me know if you have more suggestions!
      Links
      https://github.com/MoritzLost/ProcessCacheControl ProcessCacheControl in the Module directory CHANGELOG in the repository Screenshots


    • By Macrura
      PrevNextTabs Module
      Github: https://github.com/outflux3/PrevNextTabs
      Processwire helper modules for adding page navigation within the editor.
      Overview
      This is a very simple module that adds Previous and Next links inline with the tabs on the page editor. Hovering over the tab shows the title of the previous or next page (using the admin's built in jqueryUI tooltips.)
      Usage
      This module is typically used during development where you or your editors need to traverse through pages for the purpose of proofing, flagging and/or commenting. Rather than returning to the page tree or lister, they can navigate with these links.
      Warnings
      If you are using PW version 2.6.1 or later, the system will prevent you from leaving the page if you have unsaved edits.
      For earlier versions, to avoid accidentally losing changes made to a page that might occur if a user accidentally clicks on one of these, make sure to have the Form Save Reminder module installed.
      http://modules.processwire.com/modules/prev-next-tabs/
    • By EyeDentify
      Hello Dear PW Gurus.

      Hope you fair well in these Corona Crisis times.

      Anyhow, i have a problem with a Cryptic error message that shows up when i am trying to Delete images out of a Images field.
      The Error message does say a little but it does not make sense to me why i can´t delete the images because of it.

      Is it some permission issue perhaps?

      I will attach screenshots of it and what i did prior to it.
      I am from sweden so ignore the funny words here and there.

      Hope you all can send me on the right track.
      i am running PW 3.0.139 on this install.

      Step1:

      Step 2: Select the images with the trashcan symbol

       
      Step 3: Cryptic Error message

      I am scratching my head on this one, have not seen this before.

      Thankfull for all help.
      /EyeDentify
    • By Gadgetto
      SnipWire - Snipcart integration for ProcessWire
      Snipcart is a powerful 3rd party, developer-first HTML/JavaScript shopping cart platform. SnipWire is the missing link between Snipcart and the content management framework ProcessWire.
      With SnipWire, you can quickly turn any ProcessWire site into a Snipcart online shop. The SnipWire plugin helps you to get your store up and running in no time. Detailed knowledge of the Snipcart system is not required.
      SnipWire is free and open source licensed under Mozilla Public License 2.0! A lot of work and effort has gone into development. It would be nice if you could donate an amount to support further development:

      Status update links (inside this thread) for SnipWire development
      2020-03-21 -- SnipWire 0.8.5 (beta) released! Improves SnipWires webhooks interface and provides some other fixes and additions 2020-03-03 -- SnipWire 0.8.4 (beta) released! Improves compatibility for Windows based Systems. 2020-03-01 -- SnipWire 0.8.3 (beta) released! The installation and uninstallation process has been heavily revised. 2020-02-08 -- SnipWire 0.8.2 (beta) released! Added a feature to change the cart and catalogue currency by GET, POST or SESSION param 2020-02-03 -- SnipWire 0.8.1 (beta) released! All custom classes moved into their own namespaces. 2020-02-01 -- SnipWire is now available via ProcessWire's module directory! 2020-01-30 -- SnipWire 0.8.0 (beta) first public release! (module just submitted to the PW modules directory) 2020-01-28 -- added Custom Order Fields feature (first SnipWire release version is near!) 2020-01-21 -- Snipcart v3 - when will the new cart system be implemented? 2020-01-19 -- integrated taxes provider finished (+ very flexible shipping taxes handling) 2020-01-14 -- new date range picker, discount editor, order notifiactions, order statuses, and more ... 2019-11-15 -- orders filter, order details, download + resend invoices, refunds 2019-10-18 -- list filters, REST API improvements, new docs platform, and more ... 2019-08-08 -- dashboard interface, currency selector, managing Orders, Customers and Products, Added a WireTabs, refinded caching behavior 2019-06-15 -- taxes provider, shop templates update, multiCURL implementation, and more ... 2019-06-02 -- FieldtypeSnipWireTaxSelector 2019-05-25 -- SnipWire will be free and open source Plugin Key Features
      Fast and simple store setup Full integration of the Snipcart dashboard into the ProcessWire backend (no need to leave the ProcessWire admin area) Browse and manage orders, customers, discounts, abandoned carts, and more Multi currency support Custom order and cart fields Process refunds and send customer notifications from within the ProcessWire backend Process Abandoned Carts + sending messages to customers from within the ProcessWire backend Complete Snipcart webhooks integration (all events are hookable via ProcessWire hooks) Integrated taxes provider (which is more flexible then Snipcart own provider) Useful Links
      SnipWire in PW modules directory SnipWire Docs (please note that the documentation is a work in progress) SnipWire @GitHub (feature requests and suggestions for improvement are welcome - I also accept pull requests) Snipcart Website  
      ---- INITIAL POST FROM 2019-05-25 ----
       
×
×
  • Create New...