This is a discussion on Adding Search to within the HTML, CSS, and Design Help forums, part of the General category; Another couple template questions... 1. Can someone also give me a heads up how to add 'Quick Search Box' to ...
|
|||||||
|
|
LinkBack | Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
Another couple template questions...
1. Can someone also give me a heads up how to add 'Quick Search Box' to layout.tpl (ie navigation) home.tpl (in body) or in new pages yet to be created eg., subject.tpl If i simply add javascript and html code from search.tpl to home.tpl I only see text search and category search (and dropdown doesnt work) in browser. So obviously Im missing one or three steps somewhere. Ideally Id like to have ability to add a 'Quick Search Box' in a number of places and modify the code so it so it can display only fields I require. 2. How do I modify price fields so that they can be displayed as dropdowns? Had a look in cache from old forum but cant access posts I need. Cheers, sleepy Last edited by sleepy; 04-09-2006 at 01:50 AM. |
|
#2
|
||||
|
||||
|
If you add it to both layout.tpl and home.tpl you will get 2 search boxes.
you'll need to add this code to each page that you want to display the search box. PHP Code:
__________________
Regards, John mods.auscity.com �By perseverance, study, and eternal desire, any man can become great.� George S. Patton |
|
#3
|
||||
|
||||
|
juven14,
I havent yet decided where I want search box yet so was wanting to know how to do it for both templates .... If I add search box to home.tpl whereabouts do I add the 3 lines of code you posted? ... to home.tpl also or to one of the .php pages? Cheers, sleepy |
|
#4
|
||||
|
||||
|
index.php only.
By doing this you would only display the search box on the home page.
__________________
Regards, John mods.auscity.com �By perseverance, study, and eternal desire, any man can become great.� George S. Patton |
|
#5
|
||||
|
||||
|
juven14,
I must be still doing something wrong ... last part code for index.php now reads $class_tpl->assign('title', $title); $class_tpl->assign('cols', $indexCols); $class_tpl->assign('data', $cat); $class_tpl->assign('body','home.tpl.php'); $class_tpl->display('layout.tpl.php'); //get the categories for the function// $tree = cat_tree("", 0); $class_tpl->assign('getcats', $tree); ?> Is this correct? And if I wanted to add search box to layout.tpl instead what .php page do I post code to? Cheers, sleepy |
|
#6
|
||||
|
||||
|
It needs to go here:
PHP Code:
PHP Code:
{if $search=="Y'}search box{/if} Then you could just add that code to the pages you wish to show the search box. If you want it to show on every page then I would suggest making a plugin.
__________________
Regards, John mods.auscity.com �By perseverance, study, and eternal desire, any man can become great.� George S. Patton Last edited by juven14; 04-09-2006 at 11:39 AM. |
|
#7
|
||||
|
||||
|
I've made a quick mod you can use.
I'll add the link to the mod thread once I upload it there.
__________________
Regards, John mods.auscity.com �By perseverance, study, and eternal desire, any man can become great.� George S. Patton |
|
#8
|
||||
|
||||
|
Thanks juven14,
Do you know if theres any info about on how to create a plugin? Tried to cache old site but had no luck. sleepy |
|
#9
|
||||
|
||||
|
Here is a link to the mod.
http://www.68classifieds.com/forums/...69&postcount=1 You can just use my plugin here as a template for creating your own plugins. I just stripped down another plugin and followed how it was put together. I used the function name as the file name and saved it in the plugin folder as the other functions where done. plugin name = function.functionName.php: PHP Code:
Code:
{functionName}
__________________
Regards, John mods.auscity.com �By perseverance, study, and eternal desire, any man can become great.� George S. Patton |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| city drop down won't search | NetGirl | v3.1 Questions & Support | 7 | 12-10-2006 11:15 PM |
| Aligning the "zip code," etc. search fields | spaceboy | v3.1 Modules & Modifications | 5 | 09-09-2006 02:27 PM |
| Drop Down Search Issue | CB | v3.1 Questions & Support | 2 | 06-23-2006 12:04 AM |
| Adding Short Description To Search Results | CB | v3.1 Questions & Support | 5 | 06-22-2006 04:52 PM |
| Adding the Owner Name to the search results | robgo777 | v3.1 Questions & Support | 6 | 06-13-2006 10:21 AM |