Jump to content

First page of pagination always active!


Java
 Share

Recommended Posts

Hi

The pagination on my site works, that is to say button 1 gives page 1, button 2 gives page 2, 3 page 3 and so on. But page 1 always remains the current, active page no matter what I do, so the pagination display always remains 1 2 3 NEXT.
I've searched the forum front to back and back to front, but haven't found a solution to this problem.
The code I am using is simple:

$items = $page->children("limit=n");
  $pager = modules('MarkupPagerNav');
  echo $pager->render($items);
  echo $page->body;
foreach($page->children("limit=15") as $child)

The attached image shows the generated code.

What could be wrong here?

pagination.jpg

Link to comment
Share on other sites

Thanks wbmnfktr. I've seen that and I've tried it, but it makes no difference.
More out of desperation than wisdom I changed "n" to "15" and it works!
So the code is now:
$items = $page->children("limit=15");
echo $pager->render($items);
foreach($page->children("limit=15") as $child)
I'm curious about the explanation of this.

  • Like 1
Link to comment
Share on other sites

On 1/24/2023 at 11:31 AM, Java said:

I changed "n" to "15" and it works!

Ok... I didn't notice your usage of n in your query/selector but what @taotoo said is true.

n is a placeholder for n=number/integer for the amount of entries/pages/items (however you wanna call it).

It's the number of entries you want to see.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...