[an error occurred while processing this directive]

Proven web content management for your listings website

Listings Manager Tutorial: Sorting by Price

    By default, your main listings page orders the information alphabetically by the address field. But what if you want to sort by some other field, like price? To do this, what you can do is link directly to the search engine instead, and use it to search by a specific field.

    Here's an example of how to create a link that links directly to the search results of all of your listings sorted by price.

    1. First go to Listings Manager's setup options and make sure "Enable database sorting?" is set to "yes".
    2. Open up your _search_query.html template file (stored in your /templates/[industry]/ directory) and add the following. (Make sure to add this somewhere between the open <form> and closing </form> tag).

          <input type="hidden" name="sort_order" value="5,123,forward">

      By default field 5 is the price field, so we enter in '5' as the value. If you use a different database field number to store the price information you'll want to make the appropriate changes. Also, replace 'forward' with 'reverse' if your want your listings to be sorted with the most expensive listings first.
    3. Now go to your search query page in your browser (/exec/search.cgi). To get there, you can just click on "Search Listings" from one of the pages generated by Listings Manager. Perform a generic search (don't fill out any of the search fields - just click search.) This search should return all of your listings.

      Note: you can also specify the results to be shown per page with the "perpage" field in your search form (/templates/[industry]/_search_query.html). You'll need to add (or modify) a hidden input element containing this information:

          <input type="hidden" name="perpage" value="10">

      Feel free to change the value "10" to accommodate however many results you want each page to display.

    4. Next, copy and paste the search results URL from your browsers address bar. Replace this URL with the URL you normally use to link people to the HTML file listings index. You'll probably want to make this URL replacement in all 6 of your template files.
    5. Now when people click on "view our listings" they'll be taken to the entire search results of all of your listings, displaying 10 listings per page, and sorting by price.

Did this "How to" make sense? Send us your feedback, or let us know if you're using something like this on your installation of Listings Manager and we'll link to it as an example.


More Information: Buy Now | Questions or Comments? 

[an error occurred while processing this directive] [an error occurred while processing this directive]