Hello/Hi/Greetings,
I love the Fotorama plugin, but it lacks the ability to zoom, especially on mobile phones. As I mentioned in another thread, I started hacking a variant of the Fotorama plugin based on PhotoSwipe. There's a demo/test here: https://matthieu-moy.fr/piwigo/index.php?/category/1 . The interesting code is essentially [Github] Piwigo-Fotorama file template/photoswipe-content.tpl.
I'm now wondering how to proceed. Initially I thought this would become a standalone plugin, as an alternative to Fotorama. BUT ... there's a lot of code in main.inc.php that deserves to be shared between Fotorama and PhotoSwipe (and honestly, it's rather obscure to me who's not used to Piwigo's code). So I'm wondering whether both Fotorama and PhotoSwipe should live in the same plugin, with a configuration option "use Fotorama"/"use PhotoSwipe", and perhaps "use PhotoSwipe on mobile browser, and Fotorama otherwise" (I really prefer PhotoSwipe on mobile, but Fotorama's thumb mode on desktop is kind of cool also, so choosing the tool to use depending on the client may be nice too).
Any advice on what to do next?
Thanks,
Last edited by mmoy (2022-12-01 11:06:31)
Offline
I've sent a pull-request to Piwigo-Fotorama, comments are welcome there too.
Offline
Very interesting. I'm going to make deeper tests. 2 first feedbacks:
1) funny piece of code ;-)
<div id="Matthieu"></div>
2) offering option photoswipe/fotorama for mobile on one side and desktop on another side is a purely technical option. It is absolutely impossible to understand for a non-developer user. Could we find a piece of explanation to provide next to this option?
Offline
Oops, I said my code was still a draft, a leftover piece of debug code was indeed still there ;-).
The admin page still requires some love. My plan was:
- to write a short explanatory text saying what Fotorama and PhotoSwipe are, with the pros and cons of each backend, just above the dropdown menus to chose the backend.
- to have explicitly a part about configuring Fotorama and another about configuring PhotoSwipe (but right now, PhotoSwipe is not configurable), probably greying out the section of a backend when it's not selected at all.
- Maybe have a part with common options (e.g. "add an info button" that would apply to both Fotorama and PhotoSwipe), but I'm not sur whether it's a good idea: if the user choses only one backend, the "common options" part doesn't have a real added value, and if they chose different backends for desktop and mobile, maybe it's a good idea to allow different customization for both.
I just wanted preliminary feedback before doing this, because none of this would make sense if the idea of having both backends in the same plugin is discarded.
Offline
mmoy wrote:
I just wanted preliminary feedback before doing this, because none of this would make sense if the idea of having both backends in the same plugin is discarded.
I think both backends are valid options and if they are in 2 separate plugins, they would be conflicted. Having them both in the same plugins give the choice to the user on which backend to use and use one for desktop and another one for mobile (what I write is obvious for you, I just write it for readers who would not understand the advantage to have 2 possible backends in the same plugin).
For me, it's a GO :-)
Offline
OK, we're on the same page :-). I wrote a quick todo-list on the PR's text on GitHub. If you have a bit of time, any help on the combine_css / combine_script issue (currently last item on the todo-list).
Offline
FYI, I finally got time to clean up my code a bit, the PR is now in a reasonable shape.
Offline
Hi,
Just a ping, my PR is waiting for someone to review/merge it :-).
https://github.com/Piwigo/Piwigo-Fotorama/pull/25
Cheers,
Offline
First review done but blocked very quickly. I reported a problem with new configuration settings.
I swear my second review will come much faster ;-)
Offline
In case you've missed it, I've updated my PR and it should be ready for review.
(And there's another unrelated but straightforward, literally 2 lines, fix here that I'd like to get merged too https://github.com/Piwigo/Piwigo-Fotorama/pull/26 )
Thanks,
Offline