-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Slideshow Plugin #14
Comments
I think it's a great suggestion, but I can't promise any timeline. So if you're willing to play around with it, contributions are always welcome 🙂 |
ok, fine - I'll see if I can get this working, guess I will have to figure out how to add esm modules to grav first. |
I'd need to have a closer look here, but I don't think you should add any ESM modules to Grav itself. How I imagine this:
I believe that should do it |
Am Donnerstag, 28. Dezember 2023, 17:21:18 CET schrieb Karmalakas:
I'd need to have a closer look here, but I don't think you should add any
ESM modules to Grav itself.
that is also my impression - there does not seem to exist a method to do this,
as `$this->grav['assets']->addJs() ` is not meant to import modules, just add
pure javascript.
edit: I just saw there is [this](https://learn.getgrav.org/17/themes/asset-manager#addjsmodule-asset-options) which seems to be meant to load modules, will check it out...
How I imagine this: - Add 2 options to plugin
config
- Enable slideshow
- Slide change time (default I see is 4 secs)
agreed - these are the 2 minimum Options here, maybe also some transititon
effect (slide, fade...) later
- If slideshow is enabled, add required JS in the plugin itself together
with the main JS
I'll see how to do this, as far as I see, the code from the slidshow plugin is
only available as an esm module.
- Add required config in the JS part of code
yes.
|
There's addJsModule() for Twig, and also in the Assets class (undocumented). Wonder why Slideshow plugin does not use the conventional .mjs extension then 🤔 Anyway, I think, depending on config, this module should be added somewhere in here |
yes, PhotoswipeExtension.php will be the right place to add the module. |
well, after some fiddling with several approaches, I got it going with Grav, BUT: only through adapted templates, no plugin. so far, my efforts to incorporate the functionality into grav-plugin-photoswipe all failed. |
so, after some more tries, I have come to the point where I think the Problem is really that Grav Asset Manager just can't load esm Modules, which is bad, as more and more Projects only provide these nowadays, including photoswipe. |
OK, so this slideshow plugin is for v5, and v5 I see is a complete rewrite. I guess at first I'd need to update this plugin to use the v5 and only then we can look into slideshow. I don't think I will get to rewriting my plugin to support v5 any time soon though |
Am Samstag, 30. Dezember 2023, 15:35:47 CET schrieb Karmalakas:
OK< so this slideshow plugin is for v5, and v5 I see is a complete rewrite.
I guess at first I'd need to update this plugin to use the v5 and only then
we can look into slideshow.
yes, seems so.
I don't think I will get to rewriting my plugin
to support v5 any time soon though
ok, no problem - in the end, it is your time and your decision :-)
I will now wait if my issue #3783 will get some response and/or resolution.
maybe I'll investigate further then.
in the meantime, I can live with my ugly template solution for pages where I
need a slideshow.
|
this is just a feature request, not an issue 😄 - I would find it useful to add a Slideshow feature (maybe configurable, if desired or not) and stumbled over this one.
what do you think about this ?
greetings
Werner (aka hoernerfranz in the Grav Discourse Forum)
The text was updated successfully, but these errors were encountered: