Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I've noticed a strange behaviour about the way Photowall is sorting the images.
At the best, while using the 'reverse order' option, I'm getting the following pattern:
3 - 2 - 1
6 - 5 - 4
10 - 9 - 8 - 7
instead of
1 - 2 - 3
4 - 5 - 6
7 - 8 - 9 - 10
Without the 'reverse order' option enabled, it become even more far from what I'm expecting, like:
7 - 8 - 9 - 10
4 - 5 - 6
1 - 2 - 3
I think that the default sorting should by default be descending, from left to right and the reverse order also working from left to right by default.
Or could some one suggest a way to change to ltr ?
Thanks for help.
Comment | File | Size | Author |
---|---|---|---|
#6 | with tanmayk/jquery-photowall library | 404.67 KB | sahaj |
#6 | with tanmayk/jquery-photowall library | 402.48 KB | sahaj |
#6 | edit mode images order | 110.14 KB | sahaj |
#4 | Screen shot with page and code source.png | 364.55 KB | sahaj |
#1 | From the editor.jpg | 84.97 KB | sahaj |
Comments
Comment #1
sahaj CreditAttribution: sahaj commentedHere are 2 screen copies showing both order, from the editor and as rendered by Photowall.
Comment #2
sahaj CreditAttribution: sahaj commentedHi,
I really would like to find out how to solve this issue. It maybe looks as a details, but my customer is very sensitive about this point, as he is using Plup to sort his images in an esthetic and logical way and this really make his task painful.
Unfortunately, I'm not a PHP coder, but going through the data, I noticed these lines in the 'theme.inc' file:
May the 'array_reverse' be the cause of the reverse ordering? If yes, how could it be... reverted?
Comment #3
tanmaykReally sorry for replaying too late, was damn busy in some stuff.
As you are saying, images are appearing in reverse order, you can try commenting the line:
$variables['items'] = array_reverse($variables['items']);
If that work, its well and good. But the photowall plugin adjusts the images and its ordering to fit them in proper box, so commenting should not work.
Let me know, if that worked or else I don't see any other option to do so.
Comment #4
sahaj CreditAttribution: sahaj commentedThanks for your answer tanmayk, unfortunately commenting the line did not change anything.
What is also funny, is that I had to check the 'Display in reverse order' checkbox within the formatter styles, otherwise it will start from the end, but still from the right side.
In order to help to understand, I'm adding a screen shot, showing also the page source, where we can see that #photowall-1 is on the top right.
With all my respect, it seems to me that the jquery plugin works only in RTL mode or have something upside-down. I also tried to check the original version of the jquery plugin (http://creotiv.github.io/jquery-photowall/example.html), indeed it is not so obvious because the 'cells' are getting some id as '#5685978514809915474', however, while resizing the page the first image is staying on the top left position.
This apart, I'm thankful for porting the plugin to Drupal, and would not have noticed this issue without the customer pointing it to me.
Comment #5
sahaj CreditAttribution: sahaj commentedHi tanmayk,
I just made some test with the original library (https://github.com/creotiv/jquery-photowall) and I should say that it output the image in a more logical order. So it seems clear to me that the issue comes from your jquery library rewrite.
Could you please give more information about which js break in module the original version was causing ? Maybe it is fixed now ?
Thanks for help.
Comment #6
sahaj CreditAttribution: sahaj commentedI am adding below the different screen shots demonstrating the issue.
* sorry the second screen shot is 'with creotiv/jquery-photowall library'
Comment #7
tanmaykYeah, you are right. I've also tried with creotiv/jquery-photowall library. It displays images in correct order after commenting the line $variables['items'] = array_reverse($variables['items']);
But still, I am having an issue with zoom and full view. Can you check, if images are zoomed as before and also full view (after clicking on image) is working?
I'll see, if I can integrate that library with module. :)
Comment #8
tanmaykTo make creotiv/jquery-photowall library working, use JQuery Update module. It requires JQuery >= 1.7.1
Let me know, if that works.
I will update the project page after next release.