?
avatar dgrammatiko
dgrammatiko
26 Dec 2016

Steps to reproduce the issue

Custom Fields introduce a plugin for image gallery: fotorama.io
Can we either drop this plugin altogether or find a vanilla script or use bootstrap's carousel?

avatar dgt41 dgt41 - open - 26 Dec 2016
avatar joomla-cms-bot joomla-cms-bot - change - 26 Dec 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Dec 2016
avatar Bakual Bakual - change - 26 Dec 2016
Title
Can we drop fotorama plugin?
[com_fields] Can we drop fotorama plugin?
avatar Bakual Bakual - edited - 26 Dec 2016
avatar Bakual Bakual - change - 26 Dec 2016
Title
Can we drop fotorama plugin?
[com_fields] Can we drop fotorama plugin?
avatar dgt41
dgt41 - comment - 26 Dec 2016

A far better script for this could be: http://photoswipe.com
Is MIT, supports IE8, lazy loading, is accessible and a gazzilion more goodies comes with it!
And of course is lighter and dependency free!

avatar Bakual
Bakual - comment - 26 Dec 2016

What does the current gallery field do? It didn't work for me on XAMPP when I tried so can't say.

I think it's mainly meant as an example field. It doesn't have to have many options (there are currently no parameters anway in the plugin).
I haven't an issue with it being a jQuery plugin. That alone isn't an argument to me. It's a plugin and if someone doesn't want to use a jQuery gallery plugin, then he is absolutely free to use another one.

avatar laoneo
laoneo - comment - 26 Dec 2016

Yes it's not needed anymore when pr #13319 is finished and merged. Altough would be nice to have a gallery plugin in core.

avatar ggppdk
ggppdk - comment - 27 Dec 2016

It didn't work for me on XAMPP when I tried so can't say.

Do you have windows ? you can test this PR:
#12844

Also see the comments in the code , it is easy to see why the 2 small changes suggested by it are correct

avatar Bakual
Bakual - comment - 27 Dec 2016

Altough would be nice to have a gallery plugin in core.

I agree it is nice to have one since it's a common requested feature.
@dgt41 has a point in that we add another JS to our core. We could do this plugin as a very basic image slider using the Bootstrap Carousel (http://getbootstrap.com/2.3.2/javascript.html#carousel). This way we wouldn't need any added JS or CSS at all.
It would of course miss the thumbnails the current fotorama JS does, Not sure if that is needed.

avatar dgt41
dgt41 - comment - 27 Dec 2016

@Bakual we can still have thumbs with bootstrap carousel: http://bootsnipp.com/snippets/featured/carousel-extended

avatar Bakual
Bakual - comment - 27 Dec 2016

Yeah with custom JS of course it is possible. The slider itself would be possible with any custom JS at all. You just need the call to JHtml::_('bootstrap.carousel'); and add the appropriate HTML stuff.

avatar Fedik
Fedik - comment - 28 Dec 2016

how to cook a simple gallery:

  • make grid layout of images with HTML/CSS (make thumbs with PHP, if need)
  • add lightbox script (bootstrap modal?)
  • profit
    It even can be without modal, just open the "fullsized image" in new tab ?

Make thumbs with JavaScript it a very bad idea: User will upload full photos with 6MB size each and JavaScript make it smaller. Very "useful" gallery, especial on mobile ?

avatar dgt41
dgt41 - comment - 28 Dec 2016

@Fedik I think there is more than just a thumbnail that is required here. Responsive images should be considered, https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images

<img srcset="elva-fairy-320w.jpg 320w,
             elva-fairy-480w.jpg 480w,
             elva-fairy-800w.jpg 800w"
     sizes="(max-width: 320px) 280px,
            (max-width: 480px) 440px,
            800px"
     src="elva-fairy-800w.jpg" alt="Elva dressed as a fairy">

A gallery that doesn't support responsive images, in 2017, it's outdated and totally useless...
My 2c

avatar Fedik
Fedik - comment - 28 Dec 2016

who cares about all that fancy stuff ?

avatar Bakual
Bakual - comment - 28 Dec 2016

I would avoid having a full fledged gallery plugin in core. Leave that to 3rd party developers. They can do all the fancy stuff.
Imho we just need to have some very basic example plugin so 3rd parties have an easy way to figure out how it works.

avatar dgt41
dgt41 - comment - 28 Dec 2016

Imho we just need to have some very basic example plugin so 3rd parties have an easy way to figure out how it works.

If that's the purpose of this plugin, then make another repo for that and DON'T ship it with as core plugin.

avatar ggppdk
ggppdk - comment - 28 Dec 2016

If that's the purpose of this plugin, then make another repo for that and DON'T ship it with as core plugin.

It is good that Joomla has a gallery field by default,

  • just make it flexible to use other JS libraries to display the images, that is both inline galleries and popup (clickable thumbnails) (or hybrid)

to do the above the gallery logic should be limited to exist only inside the display ('render') layout

I think to offer 3 options by default and create 3 layout files

  • plain thumbnail list
  • bootstrap-based carousel
  • fotorama-based

e.g. existing file:
plugins\fields\gallery\layouts\field\prepare\gallery.php

should be renamed to be:
plugins\fields\gallery\layouts\field\prepare\fotorama.php

... and in future joomla will also need to add ... fotorama.xml ... an XML file per layout ... for the layout-specific configuration

Then the parameter to display layout should be a "filelist" element or similar looking into folder(s):
plugins\fields\gallery\layouts\field\prepare
and to the other layout overriding folders ...

so that 3rd party template authors and extension authors can add more
and the layout parameter should be of course added to 'all' fields which are now being made a joomla 'plugin'

avatar Bakual
Bakual - comment - 28 Dec 2016

If that's the purpose of this plugin, then make another repo for that and DON'T ship it with as core plugin.

An own repo for a 5 file plugin? That's a bit to much administrative overhead I think.
It's fine to have it in core.

It is good that Joomla has a gallery field by default,

It's a good example plugin, yes.

just make it flexible to use other JS libraries to display the images, that is both inline galleries and popup (clickable thumbnails) (or hybrid)

Please don't do an extended gallery plugin with various options and layouts. That's overkill and gets out of hand fast. Please leave that to 3rd parties.
We don't need a customisable or library agnostic plugin. It's very simple to create an own one if needed.

avatar dgt41
dgt41 - comment - 28 Dec 2016

It is good that Joomla has a gallery field by default,

I am afraid I will disagree here. If the core provided plugins are not covering most use cases, then the plugin should not be delivered. And this plugin as is (only one image size) is not gonna help anyone achieving something good.

Either provide something that supports, lazyloading, responsive images, good support for touch devices (e.g. #13375 (comment)) or drop this, as it's gonna be another plugin that most people have to disable!

avatar dgt41
dgt41 - comment - 28 Dec 2016

@ggppdk the layouts could work here, although there is some code missing for creating thumbs and different sizes of images (for responsive).
Anyways, my point is, that for 2017 the fotorama.io script is inefficient for most use cases. If there is a need to include this in core at least provide a good js script with it: http://photoswipe.com

avatar ggppdk
ggppdk - comment - 28 Dec 2016

It's very simple to create an own one (own plugin) if needed.

This is very true too,

  • yes, it is relative easy (for developers) to create a own new plugin
  • and ... with some minimal coding effort you can even use data of an existing field without duplication, just by changing plugin type in db

but layout selection inside the field configuration also serves a very different purpose
You have this problem:

  • you have 20 fields of type and the all use a "default" "rendering" layout

how do you display differently some of them if needed ?
i do not mean style differently

  • i mean different HTML for each of them to serve a different purpose

ok actually you can !

  • with a layout override that will have some if / switch statement that based on the field ID or the 'render' class, will display different HTML as needed

still it is not a neat solution / and takes more effort to maintain it, than just selecting layout inside the field configuration , and then going and modifying the specific layout file

-- also you can even add inside the field configuration, option to create a new layout file and edit them directly there

about removing fotorama, and / or using other JS, i have no opinion, i do not really care much about it

avatar ggppdk
ggppdk - comment - 28 Dec 2016

Of course as a 3rd party developer, even if Joomla does not add a layout-selection parameter

I can just add a layout-selection parameter of my own, in the parameters of my custom field-plugins,

  • that implements the functionality that i need

To be honest even if Joomla adds a layout-selection parameter, i may replace it with my own implementation, that will do exactly what i need

avatar Bakual
Bakual - comment - 28 Dec 2016

Afaik there is currently no general layout selection supported for plugins. That would need to be coded for each plugin manually. We only use plugin layouts for pagenavigation and vote plugins so far anyway.

Either provide something that supports, lazyloading, responsive images, good support for touch devices (e.g. #13375 (comment)) or drop this, as it's gonna be another plugin that most people have to disable!

Sorry, but no. It's a custom field, it is not a replacement for a full gallery. If you need that, use a regular gallery extension. Those are much better suited to do the job and there are a lot to choose from on JED.

Also keep in mind as soon as you want to add parameters to the field, that needs to be done for the field creation part or even in the plugin parameters itself.
In the item (eg article) you can only choose the folder, you can't adjust it more detailled at this point.

avatar ggppdk
ggppdk - comment - 29 Dec 2016

Afaik there is currently no general layout selection supported for plugins. That would need to be coded for each plugin manually. We only use plugin layouts for pagenavigation and vote plugins so far anyway.

Yes, it can be a parameter inside field-specific configuration (its XML parameters file)
that is added by fields that need it
i agree it does not need to be a core property that appears in all fields

avatar tonypartridge
tonypartridge - comment - 29 Dec 2016

I agree with @dgt41 even just on the responsive image support! I was at JDUK16 and they had a great guy in chatting about it. Even Wordpress natively supports this! Why are we not? It's a pain to come up but provides a much better user experience on the website if don't let properly.

avatar obuisard
obuisard - comment - 12 Feb 2017

Hello everyone, here are my 2 cents:

Every custom field type should have a default layout.

As far as the gallery is concerned, since Bootstrap is used throughout, a simple Bootstrap-made gallery should be used as the default layout. It is useless adding jQuery plugins that would get dropped on a later release. Multiplying the use of outsourced plugins multiplies issues when new updates come out.

Then, let the developers create their own layouts if they feel like their users need something more sophisticated, with 'responsive' images... and put the burden of updating the gallery scripts they use to their projects, limiting the burden on the Joomla core.

avatar Bakual
Bakual - comment - 24 Feb 2017

I put a very simple BS gallery together (without slider): #14238

avatar zero-24
zero-24 - comment - 24 Feb 2017

So we can close this @Bakual ?

avatar Bakual
Bakual - comment - 24 Feb 2017

Guess so.

avatar Bakual Bakual - change - 24 Feb 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-02-24 21:49:01
Closed_By Bakual
avatar Bakual Bakual - close - 24 Feb 2017
avatar pacificregmi
pacificregmi - comment - 17 Nov 2019

different CSS slideshow code snippet https://www.csscodelab.com/tag/css-slideshow/


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13375.

Add a Comment

Login with GitHub to post a comment