See screenshot for wacky, wacky fun:
My initial thought was it'd be pretty straight-forward to just sort these in alphabetical order. Views that go together are often named in much the same way.
However, I asked Earl about this and he pointed out that auto-reordering becomes problematic because the order of these displays matters in the case where two displays have the same path.
So sounds like Views needs a mechanism to somehow manually control the order of displays. Earl says:
it probably wouldn't be that difficult to create a command that uses the drag & drop code to re-order displays. I wouldn't do it from the tabs themselves, that'd be gnarly.
Filing as a feature request.
Comment | File | Size | Author |
---|---|---|---|
#41 | reorder-displays_5_0.patch | 11.32 KB | dawehner |
#31 | reorder-displays_5.patch | 11.37 KB | dawehner |
#23 | reorder-displays.patch | 10.52 KB | superbaloo |
#22 | reorder-displays.patch | 9.84 KB | superbaloo |
#20 | reorder-displays.patch | 9.86 KB | superbaloo |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedThe easiest solution would be on the 'default' view under view settings, have a "Displays: Reorder" link which brings up a tabledrag list of displays and resets all their positions.
It would have to be sure that the weight range starts at 1, since Views expects the positions to start at 1 and increment up.
Comment #2
dawehneradding a tag and pumping to the new version
Comment #3
superbaloo CreditAttribution: superbaloo commentedsubscribing
Comment #4
superbaloo CreditAttribution: superbaloo commentedI've done a little patch for this, here it is.
There is one last thing missing, i don't know how to make the browser refresh the page to display the new order after submission
I'm in the drupalcon, so if there is something wrong, that would be a pleasure to discuss about it :)
Comment #5
dawehnerThats quite strange, the patch does not apply to views 3.x
Here is a fix, also uses drupalalike patch format.
Comment #6
superbaloo CreditAttribution: superbaloo commentedOops sorry for this.
Could you please give me the process to make a patch in the "drupal way" ? :) I'm not too accustomed to cvs command :p
what i've done was :
Comment #7
dawehnerSure
Quite easy.
Comment #8
dawehnerSome minor things.
I don't like the naming of the variables. Why not use $display1 and $display2 or similiar.
What means return 0, why not FALSE.
This review is powered by Dreditor.
Why not change reorder with analyse, this seems to be more logically for me, because reorder belongs to the displays more then analyse.
Comment #9
superbaloo CreditAttribution: superbaloo commentedHere is with the display1 and display2 var name
and, i'm returning 0 because it's 0 in the http://fr.php.net/manual/en/function.uasort.php documentation :)
I don't understand your last point, oculd you please be more verbose ? :p
Comment #10
superbaloo CreditAttribution: superbaloo commentedAny update ?
Comment #11
dawehnerBasically switching the analyse button with your reorder button.
Comment #12
superbaloo CreditAttribution: superbaloo commentedHere it is :)
Comment #13
superbaloo CreditAttribution: superbaloo commentedHere is an update to my last patch to refresh the page by ajax
I still have some html in the code (only one line) may i move it into a new theme function.
Comment #14
dawehnerMINOR. I don't like this i indent.
alt is not what links need.
MINOR: TRUE instead of true
Why not having a header for the name. Perhaps this will also help the not so nice display of the header.
Can you explain why you are doing this. Perhaps a inline comment would be nice.
This review is powered by Dreditor.
Comment #15
superbaloo CreditAttribution: superbaloo commentedDeleted displays handling
Comment #16
superbaloo CreditAttribution: superbaloo commentedCorrections with #14 comment
For the indent issue, what do you propose ?
i've no idea which one could be better :(
Comment #17
dawehnerWhat about
Comment #18
superbaloo CreditAttribution: superbaloo commentedDeal
Comment #19
dawehnerIts still in.
I'm on crack. Are you, too?
Comment #20
superbaloo CreditAttribution: superbaloo commentedHumpf ... didn't generate the .patch ... that was the old one !
sorry for this
Comment #21
dawehnerMINOR: make a line break for */
I would use perhaps just the second line as description
I'm on crack. Are you, too?
Comment #22
superbaloo CreditAttribution: superbaloo commentedHere we go
Comment #23
superbaloo CreditAttribution: superbaloo commentedLittle css fix
Comment #24
merlinofchaos CreditAttribution: merlinofchaos commentedDuring testing, I had a view with 8 or 9 displays. I was playing around, removing, restoring, removing, restoring, reordering. When I was done, I hit save. All but 1 display got removed.
I tried to reproduce this and couldn't, so I'm not sure what triggered it.
Comment #25
SeanBannister CreditAttribution: SeanBannister commentedSub
Comment #26
superbaloo CreditAttribution: superbaloo commentedok, i would test it as soon as i would get my dev server back ! :)
Comment #27
dagmarMmm, I test this patch with 20 displays and cannot reproduce #24.
Maybe the better way to see if this patch works is using Simpletest.
However, write this kind of test can be a painful task.
@superbaloo Do you have any news?
Comment #28
merlinofchaos CreditAttribution: merlinofchaos commentedAlright, I will give this another try and see if I can make that happen again.
Comment #29
dawehnerI did some testing which some kind of crazy views, with a lot of displays fields arguments sorts etc. It worked well...
I wouldn't suggest anyone to use 6.x-3.x on production site. So why not get this done and get more people testing this.
Comment #30
merlinofchaos CreditAttribution: merlinofchaos commentedWell, I can't get it to happen again, so I've committed this.
1) I don't really like the UI, adding the button in the empty space on the left has it pretty out of the way. Maybe we need to retool the UI there. That said, I think that's a bigger project than just this patch, and we can come back and address UI later once we've got the functionality there, and get folks like yoroy and Bojhan to come up with some suggestions.
2) Didn't apply to 7.x; hardly surprising.
Note: I made one correction in the patch. There is a reference to $form[$id] that is wrong and must be replaced with $form[$key] -- this error should generate notices, so when porting to 7.x be sure notices are on.
Comment #31
dawehnerPuh patch still needs work:
submit or reorder does not work
Comment #32
nbluto CreditAttribution: nbluto commentedsubscribing
Comment #33
YK85 CreditAttribution: YK85 commentedsubscribing
Comment #34
Francewhoa+1 Subscribing
Comment #35
Brodingo CreditAttribution: Brodingo commentedSubscribing
Comment #36
AlanAtLarge CreditAttribution: AlanAtLarge commentedsubscribing
Comment #37
pippal CreditAttribution: pippal commentedSubscribing
Comment #38
dmitrig01 CreditAttribution: dmitrig01 commentedI don't see how reordering displays is useful - does it have any bearing on anything?
Comment #39
dawehnerFor example if you realize that you need a feed display for two/three different page displays. So it would make sense to have the feed display below the coresponding page display.
Comment #40
webchickYeah, see the screenshot in the OP.
He's got a display for "News" and "Coaches" and sometime later decided he needed additional attachment views for those. So now those are at the bottom, not visually close at all to their "parent" views, and it'd be much easier to grok if they were.
Of course, one could argue that one shouldn't build views with 127 displays, but hey. ;) It happens.
Comment #41
dawehnerReroling. It's still not working 100%
Comment #42
adam_b CreditAttribution: adam_b commentedsubscribe
Comment #43
zevans23 CreditAttribution: zevans23 commentedSubbing
Comment #44
dawehnerSome hours later this feature is now ported.
Comment #46
botrisTried #20 on views 6.x-2.12, after resaving the modules all works fine.
IMHO together with views_clone_display, it's a killer combo.