Support Forums


Go Back   68 Classifieds Forums > Help & Support > v4 Questions & Support

Notices

 
LinkBack Thread Tools Display Modes
Old 02-02-2009, 11:11 AM   #1
Member
 
Join Date: Aug 2008
Posts: 68
Rep Power: 5
nagrap2 is on a distinguished road
Default Adding Search to every page?

Hi,

I would like to add the advanced search options on every page of my site. Currently, the out of the box solution places just the Search input box on every page.

However, i would like to also place the List of Categories drop down, City and Country.

Can someone provide me with the approach to take. I'm not looking for all the code, just the approach.

For example, do I combine the current code that is in search.php and search.tpl into my layout.tpl file? If so, can I have statements that are present in a php file in a tpl file?

Or do I merely place the search.php code into my init.php file, since I want to make this available to all files?

Thanks in advance,
__________________
Many Thanks,

Nagrap2

Developer Version 4.1
nagrap2 is offline   Reply With Quote
Old 02-02-2009, 11:21 AM   #2
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,847
Rep Power: 111
Eric Barnes is a jewel in the rough
Default

What I would probably do is take the code from search.php and add it to a plugin. Then you could just call the plugin which would give you the form.
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 02-02-2009, 11:21 AM   #3
Moderator
 
 
Join Date: Mar 2006
Posts: 4,227
Rep Power: 103
Lhotch is just really niceLhotch is just really nice
Default

Quote:
Originally Posted by nagrap2 View Post
Hi,

I would like to add the advanced search options on every page of my site. Currently, the out of the box solution places just the Search input box on every page.

However, i would like to also place the List of Categories drop down, City and Country.

Can someone provide me with the approach to take. I'm not looking for all the code, just the approach.

For example, do I combine the current code that is in search.php and search.tpl into my layout.tpl file? If so, can I have statements that are present in a php file in a tpl file?

Or do I merely place the search.php code into my init.php file, since I want to make this available to all files?

Thanks in advance,
I think if I were to tackle something like this I would make a plugin, which is just a php script. Have it query the database to get categories, cities and countries and build dropdowns. Echo those along with the text input box and submit button withe forms target the exisiting search results script. Then all you would have to do is put the plugin name in the template where you would want the search to appear.
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Lhotch is offline   Reply With Quote
Old 02-02-2009, 11:36 AM   #4
Member
 
Join Date: Aug 2008
Posts: 68
Rep Power: 5
nagrap2 is on a distinguished road
Default

Larry / Eric,

Thanks for the prompt response.

Just so I'm clear, I would create a php file to setup the form and then call that php file from within a tpl file.

What is the correct syntax for calling the php file from within the tpl file?

Is it any of the following?

{include_php file='/path/to/file.php'}

OR

{php}
include("/home/.../public_html/includes/file.php");
{/php}
__________________
Many Thanks,

Nagrap2

Developer Version 4.1
nagrap2 is offline   Reply With Quote
Old 02-02-2009, 11:40 AM   #5
Moderator
 
 
Join Date: Mar 2006
Posts: 4,227
Rep Power: 103
Lhotch is just really niceLhotch is just really nice
Default

Quote:
Originally Posted by nagrap2 View Post
What is the correct syntax for calling the php file from within the tpl file?
The best thing to do would be to look at your home.tpl template down at the bottom you can see the call to the featured listings plugin. That plugin takes arguments so there is some additional info after the plugins name.

But in short, any file in the plugin folder is automatically accessible by just dropping the plugins name in any template ie

{myplugin}

There are different kinds of plugins but using the featured listing horizontal thats called by home.tpl should offer enough guidance to get ya started.
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Lhotch is offline   Reply With Quote
Old 02-02-2009, 06:23 PM   #6
Moderator
 
 
Join Date: Mar 2008
Posts: 839
Rep Power: 22
seymourjames has a spectacular aura about
Default

There is a search module for this 68 Classified Modules For Sale which has already been styled and provides full search on any page where you place it. Here is an example where the module comes up because there are no search results so it gives the user another opportunity to search again.

http://www.globalboatsales.com/searc...&Submit=Search
__________________
TemplateCodes.com
seymourjames is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding search option to main site search page? scott17b v3.1 Modules & Modifications 4 07-28-2008 07:39 PM
Modification: Display Search String on Search Results Page jonahcoyote v4 Modules / Modifications 22 07-26-2008 06:08 AM
Adding date search to search.php abkeller v3.1 Modules & Modifications 5 07-03-2007 10:28 AM
Adding a new page spaceboy v3.1 Questions & Support 6 09-24-2006 07:45 AM
Adding Search to sleepy HTML, CSS, and Design Help 8 04-09-2006 12:12 PM


All times are GMT -4. The time now is 02:07 AM.


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