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.
How to set additional value as parameter in views pager?
By default, the pager links in views looks like 'http://www.sample.com/sample?page=2'.
I want to make url like 'http://www.sample.com/sample?page=2&type=grid'.
I tried to use hook_views_pre_build(). But it didn't made any changes.
function phponwebsites_views_pre_build(&$view){
if ($view->name == 'review_by_articles') {
$view->set_items_per_page('10');
$view->query = array('type' => 'popular');
}
}
But i can't get correct answer as i expected.
Comments
Comment #1
MustangGB CreditAttribution: MustangGB commentedComment #2
MustangGB CreditAttribution: MustangGB commentedClosing this as outdated to tidy up a bit around here. If you're still having problems with the latest release please create a new issue.