closed Order of Galleries on Gallery list

lornawebber
@lornawebber
6 years ago
334 posts
Hi,
You were kind enough to give us the option to re-order Photo Albums, and to make the drop-down list of photo albums appear in the same order.
Would it be possible to do the same for Galleries?
updated by @lornawebber: 03/24/19 07:55:49PM
paul
@paul
6 years ago
4,326 posts
Hi Lorna - Sorry for the delay.
Can you be more specific as to what you are asking?
You can drag and drop photos in both Galleries and Photo Albums so as to order them.
Is there something different needed?
Thanks


--
Paul Asher - JR Developer and System Import Specialist
lornawebber
@lornawebber
6 years ago
334 posts
Hi Paul.
Sorry, I should have described it better.
We can, as you say, re-order the images within a Photo Album using drag & drop. At the moment we can't do this in a Gallery, but that wasn't actually what I was requesting. I don't know why that doesn't work on our site.

With Photo Albums, we have a feature which allows us to change the order the Photo Albums appear in the list of Albums (as seen on the Photo Album tab). This new order is then reflected in the drop-down list of photo albums that is shown when adding an image to an album.
What I was asking is that we would like the same facility applied to Galleries, so that we can change the order in which Galleries appear on the Gallery tab.
I attach screen shots of the Photo Album list and the Gallery list.
paul
@paul
6 years ago
4,326 posts
Quote: At the moment we can't do this in a Gallery, but that wasn't actually what I was requesting. I don't know why that doesn't work on our site.

Set the 'Allow Image Ordering' option in your Gallery module's quota tab.

As for allowing gallery ordering, let me see how that might be done.
Thanks


--
Paul Asher - JR Developer and System Import Specialist
paul
@paul
6 years ago
4,326 posts
Actually, this isn't as straightforward due to the different ways Galleries and PhotoAlbums are managed within Jamroom.
PhotoAlbums are each individual items and photos in each album are stored by their ID within that album. This means that the PhotoAlbum module can take advantage of the inbuilt Jamroom Core feature to allow users to order their albums, the same as they can order their blogs, audio items etc.
Gallery items are different in that every image is an individual item which are then grouped into galleries by a common 'gallery title'.
Hope that makes sense, but the upshot, unfortunately, is that to allow galleries to be ordered the same as photo albums would need some custom work.
Sorry.


--
Paul Asher - JR Developer and System Import Specialist
lornawebber
@lornawebber
6 years ago
334 posts
Paul, thanks for that explanation and the pointer to the Image Ordering setting which I have now changed.
I'll talk to Roy about the custom feature.

Thanks for your help.
paul
@paul
6 years ago
4,326 posts
One solution might be to add a custom 'numerical' field to the gallery update form, then in the template(s) set the jrCore_list order_by options to that field. It would then mean updating all affected galleries with a numerical value to set their display order, which might be a bit tedious.


--
Paul Asher - JR Developer and System Import Specialist
lornawebber
@lornawebber
6 years ago
334 posts
Paul, I changed the setting so images can be re-ordered within a gallery (applied to all quotas).
It seems that some galleries have been re-ordered without any action on the part of the gallery owner. Images were in order uploaded but some have changed.
Is the result of my change, and if so why is that?
lornawebber
@lornawebber
6 years ago
334 posts
Just an update to that - I turned off the ability to re-order images in a gallery. I cleared caches on PMP and on my PC but it has not caused the gallery images to be re-sequenced into most recent first.
paul
@paul
6 years ago
4,326 posts
Quote: Is the result of my change, and if so why is that?

Very likely. When you allow ordering by the user, the order they are put in is saved against each gallery item in its 'gallery_order' field, so photos in a gallery would have their fields set to 1, 2, 3, etc. When listing a gallery, templates check the quota option and if set, order by this field and not the default order (which is by their created date).
If a gallery hasn't as yet been ordered, all the 'gallery_order' fileds are '0', so the way they are then listed is somewhat random.
Hope that makes sense.


--
Paul Asher - JR Developer and System Import Specialist
lornawebber
@lornawebber
6 years ago
334 posts
Yes, it makes sense Paul, but it has upset a few people who like their galleries in date order. Sorry, I assumed images would stay in that order unless changed by the user.
I have tried disabling the gallery ordering, but it doesn't seem to have reverted to date order. Is there any way of doing that?
lornawebber
@lornawebber
6 years ago
334 posts
I find that I disabled the feature for "All Users" but still have it in my Master Admin user, and that's probably why I didn't revert to date order. I'll disable it for all quotas.

It would be nice to have a default on the gallery ordering feature so it doesn't mess up the date order when it's switched on. Is that possible?
paul
@paul
6 years ago
4,326 posts
Not sure yet, but it might be possible to modify the templates in order to ascertain if a gallery has been ordered, or not. If it has, show it in the order, if not, show it as default.
Checking this out.


--
Paul Asher - JR Developer and System Import Specialist
paul
@paul
6 years ago
4,326 posts
No - Its not easy at all to ascertain this.
Has this option been enabled previously on your site? I'm just wondering how many of your users, if any, have ordered their galleries?
If none, or very few, it might be possible to create a script that pre-orders all galleries, in their 'latest first' order. Then, you could turn on the option and nothing should change.


--
Paul Asher - JR Developer and System Import Specialist
lornawebber
@lornawebber
6 years ago
334 posts
Shame it's not simple. I thought that when the order of a gallery is changed by the user, all the images in the gallery have their 'gallery_order' changed from zero to a sequential number from 1. I was thinking that if the 'gallery_order' number of the first image is zero, it must be an un-ordered gallery and you could use the default.

I'm pretty sure this feature has never been enabled on our site so all the galleries are currently in date order. When I disabled ordering of galleries, the images went back to date order so that is the current state.
paul
@paul
6 years ago
4,326 posts
I also thought that all 'non-ordered' order values would be zero as well, and that was how I was going to determine if an ordering had taken place, but unfortunately that is not always the case as over the years it looks as though the way JR does the default ordering has changed.
If you are sure no one has previously ordered gallery images on your site, it might be possible to unify all gallery orders with a script, or even a one-off database query. Let me check that out.


--
Paul Asher - JR Developer and System Import Specialist
paul
@paul
6 years ago
4,326 posts
A simple database query on the gallery datastore should have hopefully aligned all gallery_order values with that of item created newest first, so making the enabling of user gallery ordering 'seamless'.
Try it now.
Thanks


--
Paul Asher - JR Developer and System Import Specialist
lornawebber
@lornawebber
6 years ago
334 posts
Genius!
Thanks so much for that, Paul. It's perfect.
lornawebber
@lornawebber
6 years ago
334 posts
That's all great now with the order of items within a gallery.
Can I ask again about the ability to change the order of the galleries themselves as they appear in the list of galleries for a profile (Gallery tab on profile menu)?
[From comment above]...
With Photo Albums, we have a feature which allows us to change the order the Photo Albums appear in the list of Albums (as seen on the Photo Album tab). This new order is then reflected in the drop-down list of photo albums that is shown when adding an image to an album.
What I was asking is that we would like the same facility applied to Galleries, so that we can change the order in which Galleries appear on the Gallery tab.
I attach screen shots of the Photo Album list and the Gallery list.
screenshot-pmp-art.com-2018.12.10-15-27-46 (1).jpg screenshot-pmp-art.com-2018.12.10-15-27-46 (1).jpg • 127KB
screenshot-pmp-art.com-2018.12.10-15-26-10.jpg screenshot-pmp-art.com-2018.12.10-15-26-10.jpg • 178KB
paul
@paul
6 years ago
4,326 posts
Can you attach the screen shots using the button below so that I can see them?
Thanks


--
Paul Asher - JR Developer and System Import Specialist
paul
@paul
6 years ago
4,326 posts
Notwithstanding getting the screenshots, presumably my suggestion above is not a viable option?

Quote: One solution might be to add a custom 'numerical' field to the gallery update form, then in the template(s) set the jrCore_list order_by options to that field. It would then mean updating all affected galleries with a numerical value to set their display order, which might be a bit tedious.



--
Paul Asher - JR Developer and System Import Specialist
lornawebber
@lornawebber
6 years ago
334 posts
Sorry - the screen shots were attached in the third comment on this discussion (I copied and pasted but didn't carry over the images). Here they are again.
I apologise, I got distracted by the ordering of images within a gallery and overlooked your suggestion for an option to re-order the galleries themselves. Yes I see the problem now. It does sound tedious and I don't think I'd want a customisation just for this, which is not at all essential, just a nice thing to have.
paul
@paul
6 years ago
4,326 posts
Yes, for the reasons outlined above this is not straightforward for galleries.
Get back to us if this feature does become essential for you and we'll look at it again and see what we can work out.
Thanks


--
Paul Asher - JR Developer and System Import Specialist
lornawebber
@lornawebber
6 years ago
334 posts
Sorry to be a pain. Our gallery images were in the correct default order of 'latest first' after you did your database enquiry and I switched the ordering feature on for All Quotas. However, images uploaded since then seem to be showing earliest uploaded first, and not latest first as expected.
If you can look at this gallery...
https://pmp-art.com/sanne/gallery/people/all
you will see that two day's uploads (the first 10 images) are ascending image numbers and the rest are descending image numbers.
Can I fix this (apart from moving images manually)?
You can see from the image numbers that the first 10 images are
paul
@paul
6 years ago
4,326 posts
Checking this out...


--
Paul Asher - JR Developer and System Import Specialist
paul
@paul
6 years ago
4,326 posts
Hi Lorna - Sorry for the delay on this.
Have checked your link. The problem here is that with the 'Allow Image Ordering' set, the gallery module is hard coded to order images by 'gallery_order' and not 'newest first'. As I said above, by default, when creating an image, 'gallery_order' gets set to zero, so newly uploaded images show first, ready to be manually ordered.
In order to make your existing galleries show in a 'newest first' order after turning on this option, I ran a query on your gallery datastore to set each 'gallery_order' = 200000 - 'gallery item_id'. This worked at the time of change over, but as you now see, new gallery images get their order value set to zero, hence they show first.
I cannot think of a solution to this as its the way the Gallery module is designed to work with this user option. Could maybe do something with a custom module, but first decide how critical this is to your users before we go down that road.
Thanks - Paul


--
Paul Asher - JR Developer and System Import Specialist
lornawebber
@lornawebber
6 years ago
334 posts
Paul, thanks. I understand. I'll discuss the priorities with Roy.

Tags