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

merlinofchaos’s picture

Status: Active » Fixed

the 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).

idealista’s picture

what hook should i be using to modify this?

idealista’s picture

hook or function..
not sure where to insert the logic I want to apply ;)

idealista’s picture

Status: Fixed » Postponed (maintainer needs more info)
merlinofchaos’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

I'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.

idealista’s picture

Status: Closed (won't fix) » Closed (fixed)

I added the logic to the _init() of my costum module. Seems to work fine

Thanks