![]() |
Persistent remembering of Pagination Offset for breadcrumbs - 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: Persistent remembering of Pagination Offset for breadcrumbs (/showthread.php?tid=52646) |
Persistent remembering of Pagination Offset for breadcrumbs - El Forum - 06-20-2012 [eluser]boltsabre[/eluser] Hi people, just wanted some input. I've got various sections of the site that use Pagination (ie, forums, position vacant ads, image galleries, etc). Taking Image Gallery for example, I have a breadcrumb system that looks like this: Code: //Breadcrumb structure when viewing an image gal category: When a user clicks on an image, it loads a new controller/method/variable, but I still want to keep " Category Name" name in the breadcrumbs (like this): Code: //Breadcrumb structure when viewing an image: Problem is, there is no good way to pass the "pagination offset" for my breadcrumbs for the "Category Name"... I don't want that link to always take them back to the "first page" of images for that category, but rather to the last page they were on within that category. Has anyone tackled this before? I thought the best way would be to store it somehow, and then check for it (ie, if "pagination offset" exists include it in my breadcrumb, else make my breadcrumb default to the 'first page'. Some things come to mind: 1. Store it in a cookie (but when to expire it?) 2. Store it as a session variable 3. Store it as flashdata (and use a persistent flashdata helper so that it stays active the entire time the user is in the image gallery, something like: Code: // helper function Anyone got any thoughts on the best way to handle this??? Any input would be greatly appreciated. |