Welcome Guest, Not a member yet? Register   Sign In
Can you add segments after the pagination page number? (uri_segment)
#1

[eluser]adisaco[/eluser]
is there a way to modify the url used by pagination so that I can specify where the page segment can be added like:

“http://localhost/controller/function/” . $uri_segment . “/sortby/ascending/tab1/”;

This way I can always use segment 3?

I have a page with 4 tabs, and all 4 tabs have pagination - so I want to use a separate segment for each tabs page number
#2

[eluser]pickupman[/eluser]
Looking at the code in the pagination class, it appends the incrementing offset to the end of the uri string initialized as $config['base_url']. In order to change this behavior, you would need to extend the the Pagination class and rewrite the create_links() function to accept a parameter for before and after segment variable.

Wouldn't you be able to create a set of pagination links for each tab? If you have different segments to distinguish each page, I don't think it would matter if you append the offset at the end of each of them.
#3

[eluser]adisaco[/eluser]
I'm using jquery ui tabs (http://jqueryui.com/demos/tabs/)

So the 4 tabs are actually all on one page
#4

[eluser]pickupman[/eluser]
If you are using jQuery, should make this even easier. Write a javascript function that takes parameters, (tab, target). Maybe if post some of your code, I could offer a better answer. I have done this recently on a site as well, and I didn't have to change the uri segment for each one. Use jQuery to set some variables you can pass to a controller, and then after you receive the updated response, use the variables to replace the content in the appropriate tab.




Theme © iAndrew 2016 - Forum software by © MyBB