CodeIgniter Forums
pagination class - smth between next n prev links - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: pagination class - smth between next n prev links (/showthread.php?tid=62689)



pagination class - smth between next n prev links - Tecvid - 08-15-2015

hi men! the default create_links() method of the pagination class make links be shown next to each other, like this:
   
is there any way to make it look like this:
   
or i have to hack the create_links() method? thanks in advance


RE: pagination class - smth between next n prev links - ignitedcms - 08-16-2015

Show your code.


RE: pagination class - smth between next n prev links - Diederik - 08-16-2015

There is absolutely no reason to 'hack' a file in the system directory. You will regret it when you need to update CodeIgniter to a newer version.

You should instead create your own library which extends the pagination library and add your own functions to it.

Or you could look at our problem from a different angle. You could just place the pagination output both above and below the list of your comments and use CSS to hide the next button in the top and hide the previous link in at the bottom of the page.


RE: pagination class - smth between next n prev links - ardhie1032 - 08-16-2015

Or you can modify with javascript or jQuery to hide 'prev' link and/or move it at the bottom. Maybe pagination return an array for the future.


RE: pagination class - smth between next n prev links - Tecvid - 08-17-2015

(08-16-2015, 09:47 AM)iamthwee Wrote: Show your code.

look at the docs of the pagination class Smile that's my source code)



(08-16-2015, 10:37 AM)Diederik Wrote: You should instead create your own library which extends the pagination library and add your own functions to it.

i think this variant is the best if there is no native way to do it, thanks a lot for ur advice! Smile



(08-16-2015, 02:34 PM)ardhie1032 Wrote: Or you can modify with javascript or jQuery to hide 'prev' link and/or move it at the bottom. Maybe pagination return an array for the future.

i cant use this way, cuz next button shown only if there is no javascript or it is turned off, for the users with javascript there is just prev comments buttons n comments load via ajax, anyway thanks for the advice Smile