Business, Tech, Life, and Whatever else

68 Classifieds Auto Loaded Search Fields

by Eric Barnes on December 23, 2008

It seems to be a common change in 68 Classifieds to want a category to be pre-selected when visiting the search form. This way all the extra fields are already loaded by default. This short template hack will show how it can be done.

Please keep in mind that with this change you can only have one category selected and it is recommended that all your categories share the same extra fields.

Here is a screen shot with an example:
search-screenshot

#1. Open search.tpl and find the following code:

$(document).ready(function() {

#2. Just below it add:

selectedCat(1); //where 1 is the category pre selected.
    function selectedCat(type){
        $("#response").show()
        $.ajax({
            url: 'ajax.php',
            data: 'action=extra_listing_fields&do=search&section=' + type,
            type: 'post',
            success: function (msg) {
                $("#response").html(msg);
            }
        });
    }

This also only works with v4.1.x because of the change in JavaScript library.

You May Also Be Interested In...

Import Listings into 68 Classifieds
August 18, 2009

68 Classifieds TinyMCE Module
February 12, 2009

CodeIgniter Authorization
July 10, 2009

68KB – TinyMCE Integration
November 14, 2008

Subscribe Now

If you enjoyed this post, you will definitely enjoy my others. Subscribe to the feed to get instantly updated for those awesome posts soon to come.


blog comments powered by Disqus