Show only next and previous link paginated condeigniter

I am using the pagination codeigniter class in my project, it works great for me. But there is no way to say that the class is just showing the next and previous link, see this image. I want to show the paged plus result. I would like to use next and previous link instead of numeric links, and when the user clicks on the next button, I will use Ajax to receive the request. I have no problem with pagination Ajax calls in numeric links, but I just want to show this for reference :) I don't think I can explain what I need very well, so please see the image. link text

Here is my file:

<div style="height:200px; position:relative">
                      <div id="left_nav"></div>
                      <div id="right_nav"></div>
                          <div style="width:622px;margin:0 auto;">
                          <!-- Gallery Box1 -->
                          <?php foreach($last_profile as $l) : ?>
                          <div id="galleryBoxHolder">
                            <div id="galleryBoxContent">
                                <div id="ImageHolder">
                                    <img src="dummy_data/1.gif" />                              </div>
                                <br />
                                <p><?=$l->artname?> </p>
                                <br />
                              <p style="color:#1a4688">asdasd</p>

                                <p style="color:#1a4688 ; direction:ltr"><?=$l->length?> cm x <?=$l->width?> cm</p>
                            </div>
                          </div>
                          <?php endforeach ;?>
                          <div>
                          <?=$links?>
                          </div>
                      <!-- Gallery box1 :off -->

                        </div>
                    </div>

      

Please check this url which is exactly what I need (@: title Buyers who bought this item also bought)

+2


source to share


2 answers


In version 2.0.3 of Codeigniter - for displaying Next / Previous only you can add the following config settings:



$config['display_pages'] = FALSE;
$config['first_link'] = FALSE;
$config['last_link'] = FALSE;

      

+9


source


You have several options. The first one is really simple, hide some of the pagination module thumbnails using CSS. The second option is not overly complicated: change the pagination class to not include thumbnails, and instead restrict its output to next / prev buttons. This should be somewhat trivial.

System / Libraries / Pagination Library line 199 is where "numbers" are processed. This is where you remove any addition to the $ output variable:



if ($this->cur_page == $loop)
{
  $output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page
}
else
{
  $n = ($i == 0) ? '' : $i;
  $output .= $this->num_tag_open.'<a href="'.$this->base_url.$n.'">'.$loop.'</a>'.$this->num_tag_close;
}

      

+1


source







All Articles