0

I have pagination using entity field query:

$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node');
$query->entityCondition('bundle', 'content_type');
$query->pager(3,0);
$result = $query->execute();
$pager=theme('pager');
print render ($pager);

and it is successfully displayed like below,

enter image description here

I need to restrict them to display to number 6 then ... like below
: 1,2,3,4,5,6....next,last

1

It's very easy. Just use

$pager=theme('pager', array('quantity' => 6));
  • Thanku @Eugene if I want to remove first and last tabs. Need only previous and next links.Should I implement theme_pager_last() manage in entity field query? – nomeer Jul 9 '15 at 7:17
  • I think that you should redefine theme_pager in your theme and remove first and last links from this function – Eugene Jul 9 '15 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.