CodeIgniter Forums
help with pagination links - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: help with pagination links (/showthread.php?tid=44245)



help with pagination links - El Forum - 08-09-2011

[eluser]matches[/eluser]
I have pagination set and working really well. Just one problem. The pagination is for blog posts. I have a left column with the post you are reading with a right column listing other posts with pagination at the bottom. A url where the offset is 6 and the post id is 12 would look something like this.

.../blog/index/6/12/Post-title-here

When click on the pagination the, the offset is changed and the id and title are omitted.

.../blog/index/9

How can I append that data to the pagination link?

Thanks


help with pagination links - El Forum - 08-09-2011

[eluser]Alfonso[/eluser]
try to add those variables to the $config['base_url'] , in the controller

$config['base_url'] = "http://example.com/blog/index/$post_id/$post_offset/$post_title";

but the page number is added always in the last segment , right ?


help with pagination links - El Forum - 08-09-2011

[eluser]matches[/eluser]
I would prefer to keep the current url with the title in the segment.


help with pagination links - El Forum - 08-09-2011

[eluser]Twisted1919[/eluser]
sprintf() anybody ?


help with pagination links - El Forum - 08-09-2011

[eluser]matches[/eluser]
Thanks for the reply, but I still wouldn't know how to plug the offset into the middle of the url.