montyrach Posted July 16, 2014 Share Posted July 16, 2014 I'm made my shop into a responsive bootstrap format. I'm looking to make my "Result Pages" format into a simpler navigation format. Instead of the current format for result pages Result Pages: 1 2 3 4 5 ... [Next >>] I want to show simply [<<Prev] 1 of 6 [Next >>] Of course my Prev and Next will be made into pretty bootstrap buttons ;) So, how can I modify $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))) to split out my html the way I want? Rachel M. Link to comment Share on other sites More sharing options...
burt Posted July 16, 2014 Share Posted July 16, 2014 This would be done in the split_page_results.php class file /includes/classes/split_page_results.php Link to comment Share on other sites More sharing options...
montyrach Posted July 16, 2014 Author Share Posted July 16, 2014 Thanks for that! Here's my final code in case it would help anyone :thumbsup: function display_links($max_page_links, $parameters = '') { global $PHP_SELF, $request_type; $display_links_string = ''; if (tep_not_null($parameters) && (substr($parameters, -1) != '&')) $parameters .= '&'; // previous button - disabled on first page if ($this->current_page_number > 1) { $display_links_string .= '<ul class="pager"><li><a href="' . tep_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' "><span class="glyphicon glyphicon-chevron-left"></span></a></li> '; } else { $display_links_string .= '<ul class="pager"><li class="disabled"><a><span class="glyphicon glyphicon-chevron-left"></span></a></li> '; } // check if number_of_pages > $max_page_links $cur_window_num = intval($this->current_page_number / $max_page_links); if ($this->current_page_number % $max_page_links) $cur_window_num++; $max_window_num = intval($this->number_of_pages / $max_page_links); if ($this->number_of_pages % $max_page_links) $max_window_num++; // Which page are we on of how many pages? for ($jump_to_page = 1 + (($cur_window_num - 1) * $max_page_links); ($jump_to_page <= ($cur_window_num * $max_page_links)) && ($jump_to_page <= $this->number_of_pages); $jump_to_page++) { if ($jump_to_page == $this->current_page_number) { $display_links_string .= ' Page <strong>' . $jump_to_page . '</strong> of ' . $this->number_of_pages; } } // next button, disabled on last page if (($this->current_page_number < $this->number_of_pages) && ($this->number_of_pages != 1)) { $display_links_string .= ' <li><a href="' . tep_href_link(basename($PHP_SELF), $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' "><span class="glyphicon glyphicon-chevron-right"></span></a></li></ul>'; } else { $display_links_string .= ' <li class="disabled"><a><span class="glyphicon glyphicon-chevron-right"></span></a></li></ul>'; } // Only one page ie "1 of 1" if ($this->number_of_pages == 1) $display_links_string .= 'of ' . $this->number_of_pages; return $display_links_string; } Rachel M. Link to comment Share on other sites More sharing options...
burt Posted July 16, 2014 Share Posted July 16, 2014 Here's how we did it in the Bootstrap build: http://www.template.me.uk/2334bs3/advanced_search_result.php?keywords=a&sort=2a&page=2 Scroll to bottom to see paging. Link to comment Share on other sites More sharing options...
montyrach Posted July 16, 2014 Author Share Posted July 16, 2014 That's great!! I like the grid/list option. Where can I find that build? I'd like to incorporate some of those ideas into my site. Thanks!! You can see my site here as it's being built... http://www.twinkletwinklelittleone.com/refresher/index.php Rachel M. Link to comment Share on other sites More sharing options...
burt Posted July 16, 2014 Share Posted July 16, 2014 http://www.oscommerce.com/forums/topic/396152-bootstrap-3-in-2334-responsive-from-the-get-go/ Link to comment Share on other sites More sharing options...
MrPhil Posted July 18, 2014 Share Posted July 18, 2014 It does look quite neat and organized to show something like < Page 3 of 11 >. However, I would advise you to provide a means of jumping directly to an arbitrary page, rather than forcing a shopper to click a forward or backwards button repeatedly! Some sites make the current page number a text input field (often with a "Go to" button) < Page [ 3 ] of 11 > [Go to], and some make it a drop-down selection list < Page [ 3 |V] of 11 >. For a text input field, obviously you need to validate the input as an integer between 1 and LastPage. For a select, use Javascript to autosubmit the clicked entry. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.