Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
is it possible to add a new method in view.inc file?
function set_current_page($id){
$this->pager['current_page'] = $id;
}
I want it in order to set the $id page of a view with the pager enabled. Or is there another way to set the page without having to use the url and the GET method.
Thank you.
apanag
Comment | File | Size | Author |
---|---|---|---|
#5 | views-510920.patch | 702 bytes | dawehner |
#3 | views-510920.patch | 645 bytes | apanag |
Comments
Comment #1
dawehneryou could also use hook_views_pre_query or something similar to change the $view object to what you need.
but sure if you create a patch its possible to add.
Comment #2
apanag CreditAttribution: apanag commentedWhere hook_views_pre_query is defined?
Comment #3
apanag CreditAttribution: apanag commentedHello,
here is the patch adding the above method.
Comment #4
apanag CreditAttribution: apanag commentedHello,
i know that you are working hard to provide the best results with the views module, but i need that function to add functionality to my module.
Is it possible to review the patch?
Thanks in advanced,
apanag
Comment #5
dawehnerlets first set it to needs review
ok reviewed it, two minor coding style issues, the rest is fine.
Also applies clean on 6.x-3.x
Comment #6
apanag CreditAttribution: apanag commentedHello dereine,
thanks for reviewing my patch.
apanag
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedWorks for me. Committed!
Comment #8
apanag CreditAttribution: apanag commentedThank you very much.
apanag