Support Forums

Show Search Results on sites main page.

This is a discussion on Show Search Results on sites main page. within the Templates, HTML, CSS, and Design Help forums, part of the General category; This has been asked before, but the answer wasn't given in the post, only in a PM. The question was ...


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

Reply
 
Thread Tools Display Modes
Old 02-26-2011, 06:16 AM   #1
Customer
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 241
Rep Power: 14
MrGForce is on a distinguished road
Default Show Search Results on sites main page.

This has been asked before, but the answer wasn't given in the post, only in a PM. The question was asked at the following post ....

show listings in a new layout file

Is there a post describing how to add the .... searchresults.php ... to the layout page so that the results could be displayed right there on the sites front page just as they are when using that function?

Thanks.

Rich

I'm running Developer Ver 4.1.5 .... Purple template
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline   Reply With Quote
Old 02-26-2011, 06:54 AM   #2
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,330
Rep Power: 83
seymourjames is a jewel in the rough
Default

I described one way of doing it which is to use our external search results module. This does not require coding and would drop straight in. You just need to add one line of code into your home.tpl file. This produces static listings from a predefined search criteria entered into that line of code - it is not quite what you appear to be asking.

If you want the search to be dynamic on the home page then it is a different issue. In other words you want to have search facility on the home page and then the results get displayed on posting that search on the home page.

One way would be to create a form which sends the search criteria into the external search results module which is present on the home page. This could be tricky. Not sure how to even go about that.

Another method: using a module called global search (we don't sell it anymore but I can dig it up) it is easy enough to put it on the home page and get the results to display in showlistings but again it is not quite what you are asking. We basically do this with the quick search on 68 Classifieds Version 4 Templates


The difference is that we put search on every page and it displays the results normally using showlistings.

One idea would be to use the global search module on your home page, modify your showlistings.tpl file to know it is a searchresults page and have it include the contents of the home.tpl file. The url will of course be different and not index.php. You would get the effect though.

I actually think I would do this on further reflection.

I would make sure index.php had access to all the variables available to searcresults.php. I would include the same code from showlistings.tpl in home.tpl. This means it is now capable of displaying searchresults. I would then make sure that code was primed with some search criteria. I would then include the global search module aswell into home.tpl . I would then get it to provide the results to index.php.

Probably much simpler ways to do it. Perhaps make index.php as a copy of search.php with searchresults.php thrown into it aswell . Then make home.tpl as a copy of search.tpl and also include code from showlistings.tpl.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting

Last edited by seymourjames; 02-26-2011 at 07:09 AM.
seymourjames is offline   Reply With Quote
Old 02-26-2011, 07:41 AM   #3
Customer
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 241
Rep Power: 14
MrGForce is on a distinguished road
Default

Good Morning David;

Thank you for the info. What I'm trying to do exactly is replace the homepage with the output of the searchresults page. I like the layout of that page because I can filter it with different parameters in the plugin file.... ie ... owner=XXXX ... etc

I'll try to do what you indicate above, but if there's an easier way to do what I just mentioned, please advise.

And thank you again for all your help, now and in the past. Really appreciate it.

Rich


.
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline   Reply With Quote
Old 02-26-2011, 12:04 PM   #4
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,330
Rep Power: 83
seymourjames is a jewel in the rough
Default

And you want the search form on the home page as well?

Just displaying the output of searchresults in a nice way (using a template without all the scroll bars etc) onto the home page is the easy bit using the external search results module. That bit is trivial. For example, with the module you can do this

<iframe src ="http://yourclassifieds.com/modules.php?mod=search_results&searchtext=searchte xt=porsche+&type=8&city=&state=&country=&minprice=&maxprice=&submit= Search" width="690" height="1000" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"></iframe>

This will display all porsche cars from category 8. That one line of code can be placed in home.tpl . Likewise you can use 'owner' .
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting

Last edited by seymourjames; 02-26-2011 at 12:11 PM.
seymourjames is offline   Reply With Quote
Old 02-26-2011, 01:40 PM   #5
Customer
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 241
Rep Power: 14
MrGForce is on a distinguished road
Default

Hi David;

And you're right, I DON"T want the search function to show on the front page, just the search results for a particular owner.

I was trying to get around using the iframe, but that sounds like the easiest way to go. I'll just have to make it's parameters the right size so that it doesn't show any scrollbars at any time. Sure wish Microsoft would have made it so the height would automatically adjust with the info that's within it instead of having to hard code a particular height.

Thanks again for all your help.

.
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline   Reply With Quote
Old 02-26-2011, 02:03 PM   #6
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,330
Rep Power: 83
seymourjames is a jewel in the rough
Default

Easy with the module. It follows the existing showlistings too.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 02-26-2011, 02:27 PM   #7
Customer
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 241
Rep Power: 14
MrGForce is on a distinguished road
Default

Thanks again for steering me in the right direction. Have a good weekend my friend.

Rich
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
show category names in search results business Templates, HTML, CSS, and Design Help 4 12-03-2009 03:36 PM
extra fields on show results page anna245 Technical Support 3 04-18-2008 01:31 PM


All times are GMT -4. The time now is 10:57 PM.


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