Welcome Guest, Not a member yet? Register   Sign In
Trouble with Pagination
#1

[eluser]ferno[/eluser]
Hey, I'm trying to get pagination working. The links appear looking as they should and everything else is fine, but when I click to go to the next page, the link for the first page does not become a link.

So if I have 3 pages, the links look like this:

1 2 3 >

But only 2, 3, and > are links, I can only move between them.

I can post my code if it helps, but maybe its something obvious I'm doing wrong?


Thanks!
#2

[eluser]Thorpe Obazee[/eluser]
The pagination class doesn't let you click on the current page.
#3

[eluser]ferno[/eluser]
So if I have 1 2 3 > , then 1 is not ever supposed to be a link?
#4

[eluser]Thorpe Obazee[/eluser]
If you are on page '1', page 1 is not clickable.
If you are on page '2', page 2 is not clickable.
#5

[eluser]ferno[/eluser]
Right, I figured that, so basically what I'm saying is that aspect of pagination is not working.

For me, page 1 is never clickable, yet every other page is, no matter what page I'm currently on.
#6

[eluser]Thorpe Obazee[/eluser]
Then there could be a problem with your code. I'm afraid it's time to show your code Tongue
#7

[eluser]ferno[/eluser]
heh, alright

well this is part of what my controller looks like:

Code:
$config['base_url'] = site_url("entries/$type");
        $config['total_rows'] = $e->count();
        $config['per_page'] = $per_page;
        $config['num_links'] = 2;

        $this->pagination->initialize($config);

        $data['content_left_top'] = $entries;
        $data['content_left_bottom'] = $this->pagination->create_links();
        $this->load->view('main',$data);
    }

and the relevant part of the view:

Code:
<div id="content-left">
        
            <div id="content-left-top">
                &lt;? echo $content_left_top ?&gt;
            </div>

            <div id="content-left-bottom">
                &lt;? echo $content_left_bottom ?&gt;
            </div>

        </div> &lt;!-- content-left --&gt;
#8

[eluser]Thorpe Obazee[/eluser]
I haven't looked at the code but you could look at the uri_segment value the pagination class is getting.
#9

[eluser]ferno[/eluser]
I did, and it's 3, what I believe it's supposed to be. I tried changing
Code:
$config['uri_segment']
around a bit, but no changes.
#10

[eluser]Thorpe Obazee[/eluser]
try echoing the site_url("entries/$type") if it gives you the right url.




Theme © iAndrew 2016 - Forum software by © MyBB