Support Forums

Adding Search to every page?

This is a discussion on Adding Search to every page? within the Technical Support forums, part of the Technical Support Forums category; Hi, I would like to add the advanced search options on every page of my site. Currently, the out of ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 02-02-2009, 12:11 PM   #1
Customer
 
Join Date: Aug 2008
Posts: 80
Rep Power: 16
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  
Old 02-02-2009, 12:21 PM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 136
Eric Barnes is just really nice Eric Barnes is just really nice
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
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Old 02-02-2009, 12:21 PM   #3
curmudgeon
 
Join Date: Mar 2006
Posts: 5,416
Rep Power: 139
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
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

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 02-02-2009, 12:36 PM   #4
Customer
 
Join Date: Aug 2008
Posts: 80
Rep Power: 16
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  
Old 02-02-2009, 12:40 PM   #5
curmudgeon
 
Join Date: Mar 2006
Posts: 5,416
Rep Power: 139
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
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

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 02-02-2009, 07:23 PM   #6
All Hands On Deck
 
seymourjames's Avatar
 
Join Date: Mar 2008
Posts: 3,527
Rep Power: 89
seymourjames is a jewel in the rough
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
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C
seymourjames is offline  
Closed Thread

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
Adding Search to sleepy Templates, HTML, CSS, and Design Help 8 04-09-2006 01:12 PM


All times are GMT -4. The time now is 12:59 AM.


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