Adding Search to

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 ...


Go Back   68 Classifieds Forums > General > HTML, CSS, and Design Help

 
LinkBack Thread Tools Display Modes
  #1  
Old 04-09-2006, 01:15 AM
Senior Member
 
Join Date: Mar 2006
Posts: 110
Rep Power: 13
Default Adding Search to

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.
Reply With Quote
  #2  
Old 04-09-2006, 09:23 AM
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 2,095
Rep Power: 55
Default

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:
//get the categories for the function//
$tree cat_tree(""0);
$class_tpl->assign('getcats'$tree); 
__________________
Regards,

John
mods.auscity.com

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
Reply With Quote
  #3  
Old 04-09-2006, 11:10 AM
Senior Member
 
Join Date: Mar 2006
Posts: 110
Rep Power: 13
Default

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
Reply With Quote
  #4  
Old 04-09-2006, 11:13 AM
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 2,095
Rep Power: 55
Default

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
Reply With Quote
  #5  
Old 04-09-2006, 11:30 AM
Senior Member
 
Join Date: Mar 2006
Posts: 110
Rep Power: 13
Default

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
Reply With Quote
  #6  
Old 04-09-2006, 11:36 AM
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 2,095
Rep Power: 55
Default

It needs to go here:

PHP Code:
     //get the categories for the function//
     
$tree cat_tree(""0);
     
$class_tpl->assign('getcats'$tree); 

    
$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'); 
This should always be the last line as it is the line that displays the template for you:

PHP Code:
$class_tpl->display('layout.tpl.php'); 
As for adding it to layout.tpl.php, I would have it hidden unless you pass it a variable.

{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.
Reply With Quote
  #7  
Old 04-09-2006, 11:53 AM
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 2,095
Rep Power: 55
Default

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
Reply With Quote
  #8  
Old 04-09-2006, 11:53 AM
Senior Member
 
Join Date: Mar 2006
Posts: 110
Rep Power: 13
Default

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
Reply With Quote
  #9  
Old 04-09-2006, 12:12 PM
Moderator
 
Join Date: Mar 2006
Location: NJ/NYC Area
Posts: 2,095
Rep Power: 55
Default

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:
<?php
function smarty_function_functionName(){


return 
$something;
}
?>
Then in the template where you want to use the plugin:
Code:
{functionName}
__________________
Regards,

John
mods.auscity.com

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
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
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


All times are GMT -4. The time now is 01:09 AM.


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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22