Support Forums

Search page with only 1 category

This is a discussion on Search page with only 1 category within the Modules / Plugins / Modifications forums, part of the Developer Forums category; I'm trying to get the search page to show all fields by default, as there is only one category but ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 09-19-2008, 11:29 AM   #1
Member
 
Join Date: Feb 2007
Posts: 36
Rep Power: 13
sbhkma is on a distinguished road
Default Search page with only 1 category

I'm trying to get the search page to show all fields by default, as there is only one category but a LOT of fields you can search by. Basically, I want to be able to click the "search" button and go to the search page with "Real Estate" already selected and all the searchable fields displayed. Seems kinda silly to have "select a category" when there's only 1 category. I can't hardcode the fields as they will be added to over the next few months and I don't want to have to go in and code it over and over. I just want the category to be selected by default.

Using designer version 4.0.8
sbhkma is offline   Reply With Quote
Old 09-19-2008, 11:42 AM   #2
The Master
 
Maffo's Avatar
 
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,342
Rep Power: 45
Maffo is just really nice Maffo is just really nice
Default

Im going to be looking into ways to do this soon, its a feature I want myself. Now Im not sure whether I will do it in an AJAX form where the extra fields will load once the page has appeared or whether I will have the fields generated before the page is parsed.

For either of these methods you would need the developers kit anyhows.
__________________
**Bulk Upload System** has been upgraded. Works on all v4 versions with new functionality. Free upgrade for existing customers.
Maffo is offline   Reply With Quote
Old 09-19-2008, 11:50 AM   #3
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,309
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

Actually I think you can add this below the closing form tag in the search template:
Code:
    <script type="text/javascript">
    displaySec(1); //where 1 is the category pre selected.
    </script>
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 09-19-2008, 11:57 AM   #4
Member
 
Join Date: Feb 2007
Posts: 36
Rep Power: 13
sbhkma is on a distinguished road
Default

Tried that already. No joy.
Thank you for the suggestion though!
sbhkma is offline   Reply With Quote
Old 09-19-2008, 12:05 PM   #5
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,309
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

I have just tested this and can confirm it works.

Open search.tpl and below the closing form add:
Code:
{literal}
<script type="text/javascript">
    selectedCat(9); //where 1 is the category pre selected.
    function selectedCat(type){
        document.getElementById('ajxresponse').innerHTML = '';
        var QSTRING = type;
        cp.call('{/literal}{$smarty.const.URL}{literal}/ajax.php', 'ajax_extra_search_fields', response, QSTRING);
        return false;
    }
</script>
{/literal}
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 09-19-2008, 12:09 PM   #6
Member
 
Join Date: Feb 2007
Posts: 36
Rep Power: 13
sbhkma is on a distinguished road
Default

Eric, you are awesome! Thank you so very much for this. It's exactly what I needed and it only confirms that 68 Classifieds is THE solution I will use for any classifieds needs I have for my clients. I think I'm gonna take the rest of the day off and go horseback riding!
sbhkma is offline   Reply With Quote
Old 09-19-2008, 12:13 PM   #7
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,309
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

Great news however you have to take me now.
I am going to also add this to the module release forums as it seems to be a common question or request.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modification: Display Search String on Search Results Page jonahcoyote Modules / Plugins / Modifications 22 07-26-2008 07:08 AM
Search page when Category selected zavala77 Technical Support 0 07-17-2008 02:38 PM
Extra fields to be searchable on the first search page, before a category is chosen Greg H v3.1 Modules & Modifications 5 11-28-2007 03:29 PM
Search Page Problem. URGENT!!! Pierce v3.1 Questions & Support 2 10-02-2007 03:12 PM
Extrafields to be displayed on the search results and category listings page objelland v3.1 Questions & Support 1 01-13-2007 09:50 AM


All times are GMT -4. The time now is 04:32 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0