Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.12
Component:
page displays
Priority:
Major
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Jun 2011 at 02:30 UTC
Updated:
29 Jun 2011 at 17:51 UTC
I produced a view for my client that shows comics in ascending order, with a pager.
You can see it at http://www.3chorddorks.com/.
But the client wants the initial presentation to be the LAST page of the view, not the first.
While it would seem logical to change the sort to descending, it would change the meaning of the pager's first, last, previous and next selection links.
How do I tell Views to start at the LAST node, so if there are 10 nodes, the display should start at 10 of 10, and the previous link takes you back to 9.
Thanks in advance for any assistance.
Comments
Comment #1
merlinofchaos commentedSomething like this would probably do it:
If I remember right, Views will treat any page > the last page as the last page, so that basically will force the page to be very high (pick a number higher than you'll ever go) if the page isn't already set.
Comment #2
nstrassner commentedMmm. Not sure where to place this code. I've over-ridden lots of view tpls, but have not injected code into views.
Would this be a part of an argument for the view, or a template injection?
Comment #3
merlinofchaos commentedNo, that's a hook_init that would have to go into a custom module. You'll need to look up how to create a custom module.
Comment #4
nstrassner commentedThat I can do, thank you. I just wanted to make sure the code didn't go elsewhere.
thanks for your help.