
Chris
Staff

Jun 27, 2002, 10:33 AM
Post #1 of 5
(40493 views)
Shortcut
|
Google-style page navigation in search results
|
Can't Post
|
|
Recently, one of our customers asked about creating a "page navigation bar", which would allow site visitors to quickly jump between pages in the search results instead of being forced to use only the "next page" and "previous page" links. For example: Found 74 of 351 Listings, Page 1 of 7 << < 1 2 3 4 5 ... > >> Although this functionality isn't built into Realty Manager's search engine, it's possible to achieve with a little JavaScript. To illustrate how this is done, I've created an example search_results.html template, which you can examine here: http://www.interactivetools.com/staff/chris/rm_search_result_page_navigation/_search_results.txt This is a complete search results template for Realty Manager, with the exception that it's been renamed to a .txt file. Since I've combined JavaScript and $placeholders$, viewing the template directly as HTML with your browser would cause errors! (Just like looking directly into the sun!) You can quickly find the changes I made by searching for the comments <!-- BEGINNING OF NAVIGATION CHANGES --> and <!-- END OF NAVIGATION CHANGES --> The relevant parts of the template are in <script>...</script> tags. The first <script>...</script> section sets up some variables, while the second and third actually output HTML. The second and third scripts are identical, and are repeated to have the navigation bar at the top and bottom of the page. Please note the <noscript>...</noscript> tag, which will display the default navigation links if the visitor has JavaScript disabled. If anyone has any questions about the script, I'd be happy to answer them. Chris
(This post was edited by Chris on Jun 27, 2002, 11:20 AM)
|