-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration troubles #310
Comments
What is happening is the JavaScript to create the new field settings is being executed before the script that implements I'm investigating. |
…ers can be notified after a script loads ([#310](nystudio107/craft-imageoptimize#310))
…listeners can be notified after a script loads ([#310](nystudio107/craft-imageoptimize#310))
Alright, so this was a fun one. Essentially what was happening is the JavaScript to create the ImageOptimize field settings was firing before the JavaScript module was loaded, causing an error in the JavaScript console, and nothing to appear on the page. To fix this, I added an
...which allows me to add a listener that gets notified when the script is loaded, after which I can execute the necessary JavaScript:
Documented here: https://nystudio107.com/docs/vite/#script-onload-events You can try it now by setting your semver in your "nystudio107/craft-imageoptimize": "dev-develop as 1.6.41”, Then do a lmk how you go |
I pushed a fix for the above that should fix an issue where the event was firing before the listener was even installed, in some cases (it’s async, so you never know) Doing this again should pull down the latest: "nystudio107/craft-imageoptimize": "dev-develop as 1.6.41”, Then do a lmk how you go |
Released as 1.6.41 -> https://github.com/nystudio107/craft-imageoptimize/releases/tag/1.6.41 |
This screenshot doesn't really show me anything -- can you scroll down and how me the problem area? |
Sure. The point is that I can't see these fields (image taken from the doc) This is the entire page screenshot. And of course when I go to an Entry this is what I have. By the way, am I the one that is having this problem? |
Okay, so that screenshot looks right to me. I think I'm not clearly understanding the problem you've having? If you create the field, and then go to Settings -> Assets are you unable to drag the Optimized Images field to an asset volume's field layout? |
Okay, I'm probably doing something wrong. I'm not sure I understand then how to configure the field correctly. What I did was create the OptimizedImages field into Settings ->Fields , but I can't figure out how to associate it to an asset volume. At some point I expect to do this as the doc says. But how? |
Ok thank you, now I understand and I see all the variants of an image. How do then I upload image in an Entry on Craft? |
You just upload it as you normally would, and if it is in asset volume that has an Optimized Images field added to the field layout, it'll automatically generate all of the image variants for that image. |
Right! |
Not at all, that's what I'm here for! No worries. |
Question
Hi, I'm struggling with configuration. I've just installed the plugin in its Trial version. I'm following this guide https://nystudio107.com/docs/image-optimize/using.html but when I create an OptimizedImages I have no possibilities to add to an Asset Volume despite I have it.
Moreover I can't delete or add variants. Can you help me?
The text was updated successfully, but these errors were encountered: