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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sahaj’s picture

Title: Image ordering » Images ordering
FileSize
125.67 KB
84.97 KB

Here are 2 screen copies showing both order, from the editor and as rendered by Photowall.

sahaj’s picture

Hi,
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:

$photowall = array();
  $variables['items'] = array_reverse($variables['items']);
  foreach ($variables['items'] as $num => $item) {

May the 'array_reverse' be the cause of the reverse ordering? If yes, how could it be... reverted?

tanmayk’s picture

Assigned: Unassigned » tanmayk
Status: Active » Closed (won't fix)

Really 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.

sahaj’s picture

Thanks 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.

sahaj’s picture

Status: Closed (won't fix) » Active

Hi 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.

sahaj’s picture

I am adding below the different screen shots demonstrating the issue.

* sorry the second screen shot is 'with creotiv/jquery-photowall library'

tanmayk’s picture

Version: 7.x-1.2 » 7.x-1.4

Yeah, 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. :)

tanmayk’s picture

To 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.