This tutorial runs over how to create a 'Classics' section to your website.
However it can be applied to almost any scenario. For example, you could use it
to create any of the following groups:
- motorbikes, minivans and farm-equipment,
- featured and not-featured vehicles,
- new and used vehicles.
1. Create a new listing field called Classic (Yes,No)
This can be done by going to the "Setup Options" --> "Setup Listing Fields".
Find a spare listing field where you can add this. In this example we'll use
field #25. Enter in the following:
Classic (Yes,No) - select drop down as the field type - make sure to click
the "Active Field" check box.
2. Now, whenever you create or modify a listing, you'll see a new dropdown
field for Classics. Input some listings into your "Listing Editor" with some
marked as "Yes" for Classic and some as "No".
3. Download and open up your _search_query.html template page
(/templates/_auto/_search_query.html) and add the following. (Make sure
to add this somewhere between the open <form> and closing </form>
tags.
<input type="hidden" name="lfield25_keyword" value="yes">
This hidden field tells the search engine to only return those listings
which have been marked as a Classic.
4. Now go to your search query page in your browser. (search.cgi)
Perform a generic search (don't fill out any of the search fields, just
click search.) The search results for all "Classic" vehicles should
be displayed because of the hidden field you added. Copy and paste the search
results URL from your browsers address bar. You can now use this URL to create
a link that goes directly to the search results of all of your Classic
listings. Here's an example:
<a href="the_url_you_copied_and_pasted">Click here to
view all Classic vehicles!</a>
After uploading the newly modified templates, make sure to republish all of your
files by going to the "Setup Options" and clicking each of the four publish
buttons. This actually recreates your site's webpages based on your
new template designs.
5. Finally, if you wish your ordinary search form to exclude vehicles
marked as Classic, you could repeat step 3, only replacing value="yes" with
value="no". That way, the search form will always tell the search script to
ignore those Classic listings.