Closed (fixed)
Project:
Views (for Drupal 7)
Version:
5.x-1.6
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
30 Jun 2008 at 17:36 UTC
Updated:
2 Jul 2008 at 13:19 UTC
hi,
I need help changing the value of $page when loading a view
the idea is to load the last page of a view when passing no parameters (the sort order cant change)
I already created a reverse pager for this purpose (55 54 ... 2 1), but need to alter the value of $page when loading a view with no parameters.
What function or hook should i start looking?
Thanks
Comments
Comment #1
merlinofchaos commentedthe page number is retrieved from $_GET['page'] using Drupal's built-in pager system. If you use element IDs (this is fairly rare) it's slightly more complicated than this, but if you don't, you can just set $_GET['page'] = page number (remember it numbers from 0, not 1, so your last page number is total pages - 1).
Comment #2
idealista commentedwhat hook should i be using to modify this?
Comment #3
idealista commentedhook or function..
not sure where to insert the logic I want to apply ;)
Comment #4
idealista commentedComment #5
merlinofchaos commentedI'm guessing you change this wherever you changed your pager to be reversed?
I'm not really sure what to tell you here, it kind of seems like you're dong something very custom and you need to explore the code flow and place it where ever makes sense. This isn't the kind of support I can really provide you.
Comment #6
idealista commentedI added the logic to the _init() of my costum module. Seems to work fine
Thanks