Welcome Guest, Not a member yet? Register   Sign In
Pagination problem, How I can remove the current page from right side ?
#1

Hello,

I have pagination, Everything works fine. But I need to remove current page from right side.

Here it is 7 (In Screenshot)


My code :

PHP Code:
$this->load->library('pagination');
 
           $config = array();
 
           $config["base_url"] = base_url() . "rent";
 
           $config["total_rows"] = $this->listing_model->countListing("Rent");
 
           $config["per_page"] = 12;
 
           $config["uri_segment"] = 2;
 
           $config['full_tag_open'] = '<nav aria-label="Page navigation"><ul class="pagination">';
 
           $config['full_tag_close'] = '</ul></nav>';
 
           $config['next_link'] = 'Next';
 
           $config['prev_link'] = 'Previous';
 
           $config['next_tag_open'] = '<li>';
 
           $config['next_tag_close'] = '</li>';
 
           $config['prev_tag_open'] = '<li>';
 
           $config['prev_tag_close'] = '</li>';
 
           $config['num_tag_open'] = '<li>';
 
           $config['num_tag_close'] = '</li>';
 
           $config['first_link'] = 'First';
 
           $config['last_link'] = 'Last';
 
           $config['cur_tag_open'] = '<li class="active">';
 
           $config['cur_tag_close'] = '</li>';
 
           $config['first_link'] = FALSE;
 
           $config['last_link' FALSE;


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

 
           $page = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;

 
           $data["links"] = $this->pagination->create_links(); 


Attached Files Thumbnail(s)
   
Reply
#2

it looks like it is a CSS styling problem not related to backend code.

some styles given to .active class making it to display in this way
Reply
#3

I have seen that also before and it was due to extra code in the html file
on the end of the statement.

This was a bootstrap html page with a font awesome <i> tag.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

(06-18-2019, 03:56 AM)InsiteFX Wrote: I have seen that also before and it was due to extra code in the html file
on the end of the statement.

This was a bootstrap html page with a font awesome <i> tag.
Where I can change that buddy
Reply
#5

(This post was last modified: 06-19-2019, 01:16 AM by jreklund.)

You can't remove it with Codeigniter, it's hardcoded in there. You will need to hide it with CSS.

Code:
ul.pagination li.active {display: none;}

Or better yet style it. Here is a bootstrap example:
https://getbootstrap.com/docs/4.3/compon...ive-states
Reply
#6

@jreklund

Buddy, still not working
Reply
#7

screenshot is in attachment what I'm actually looking for.

Actually Code from the template 

Code:
<nav aria-label="Page navigation">
                   <ul class="pagination">
                       <li>
                           <a href="properties-list-leftside.html" aria-label="Previous">
                               <span aria-hidden="true">«</span>
                           </a>
                       </li>
                       <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
                       <li><a href="properties-list-leftside.html">2</a></li>
                       <li><a href="properties-list-fullwidth.html">3</a></li>
                       <li>
                           <a href="properties-list-fullwidth.html" aria-label="Next">
                               <span aria-hidden="true">»</span>
                           </a>
                       </li>
                   </ul>
               </nav>




My Codeigniter pagination config

PHP Code:
public function sale()
{
 
   $this->load->library('pagination');
 
           $config = array();
 
           $config["base_url"] = base_url() . "sale";
 
           $config["total_rows"] = $this->listing_model->countListing("Sale");
 
           $config["per_page"] = 12;
 
           $config['num_links'] = 2;
 
           $config['full_tag_open'] = '<nav aria-label="Page navigation"><ul class="pagination">';
 
           $config['full_tag_close'] = '</ul></nav>';
 
           $config['next_link'] = 'Next';
 
           $config['prev_link'] = 'Previous';
 
           $config['next_tag_open'] = '<li>';
 
           $config['next_tag_close'] = '</li>';
 
           $config['prev_tag_open'] = '<li>';
 
           $config['prev_tag_close'] = '</li>';
 
           $config['num_tag_open'] = '<li>';
 
           $config['num_tag_close'] = '</li>';
 
           $config['first_link'] = 'First';
 
           $config['last_link'] = 'Last';
 
           $config['cur_tag_open'] = '<li class="active">';
 
           $config['cur_tag_close'] = '</li>';
 
           $config['first_link'] = FALSE;
 
           $config['last_link' FALSE;


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

 
           $page = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;

 
           $data["links"] = $this->pagination->create_links();
 
           $data['listRecords'] = $this->listing_model->showListing("Sale"$config["per_page"], $page);
 
           $data['title'] = 'Sale';
 
           $data['main_content'] = 'sale';
 
           $this->load->view('template'$data);




Attached Files Thumbnail(s)
   
Reply
#8

Can you make necessary changes and help out me with it ?
Reply
#9

This is a CSS matter. And can't be changed with Codeigniter settings.

https://www.w3schools.com/cssref/pr_back...-color.asp
https://www.w3schools.com/cssref/pr_text_color.asp

Apply your styling inside this tag.

Code:
ul.pagination li.active {
background-color: green;
...
...
...
}
Reply




Theme © iAndrew 2016 - Forum software by © MyBB