Display search result on another page

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
kooifong.lim
Posts: 6
Joined: Fri 4. Nov 2011, 05:51

Display search result on another page

Post by kooifong.lim »

Hi,

I know this could be a silly question but I could not find an answer after looking at the threads. I installed a search function but I see the result are displayed just below the search box.

I would like to see the result displayed on another page (on a main page, with search results only).

Any help would be appreciated.

Thank you
KF
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Display search result on another page

Post by flip-flop »

Hi,

a frist step for a solution: Search: No input field if result

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
kooifong.lim
Posts: 6
Joined: Fri 4. Nov 2011, 05:51

Re: Display search result on another page

Post by kooifong.lim »

Dear Knut,

Thank you for your kind reply. What I mean is, when I key into a search box, all the results will be displayed on the {CONTENT} page. Currently, the results are displayed just below the search box. I hope this is clear.

Thank you for your help.
Lim KF
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Display search result on another page

Post by flip-flop »

This snippet hides the search box if a result is found (search results only).

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
kooifong.lim
Posts: 6
Joined: Fri 4. Nov 2011, 05:51

Re: Display search result on another page

Post by kooifong.lim »

Thanks Knut. I will try and let you know the result. Thanks for your kind help.

Lim KF
kooifong.lim
Posts: 6
Joined: Fri 4. Nov 2011, 05:51

Re: Display search result on another page

Post by kooifong.lim »

Hi Knut,

Yes, it is working. But not as I expected :-(

I used {SHOW_CONTENT} to place the search box on the left hand side. So when I key something into the search box, the results will show beneath the box. Now when there is a result, the search box is gone, but the results are still showing on that left hand side.

What I want to see is to have the search result displayed on the {CONTENT} part of the article. Is there anything I have to do in the {CONTENT} so that search results can be shown there?

Thanks
Lim
kooifong.lim
Posts: 6
Joined: Fri 4. Nov 2011, 05:51

Re: Display search result on another page

Post by kooifong.lim »

Hi Knut,

It is like the search box at the top of this page. When I key in something, the result will be displayed on the main page.

Thnaks
Lim
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Display search result on another page

Post by flip-flop »

Hey,

you have not talked about a separate input in the left!!!!

There is also another solution.

Put it into the left, it is only a search box. The output is generated e.g. on a page named "search" . .....

Code: Select all

<!--- ==== Search =========== //-->
<div class="search_box">
<form action="index.php?search" method="post" name="searchFE" onsubmit="s=document.getElementById('customSearchInput'); if(s.value=='Search')return false;">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><input type="image" name="search_go" class="customSearchInputButton" onfocus="this.blur();" title="Search" src="img/leer.gif" width="16" height="16" /></td>
<td><input type="text" name="search_input_field" size="20" maxlength="200" id="customSearchInput" class="customSearchInput" value="" onfocus="if(this.value=='Search')this.value='';" onblur="if(this.value=='')this.value='Search';" /></td>
</tr>
</table>
</form>
<script type="text/javascript" language="javascript">
<!-- 
  document.getElementById("customSearchInput").value="Search";
//-->
</script>
</div>
<!--- ==== End Search ========= //-->

Code: Select all

form action="index.php?search"
is the alias of your real "search" site for the output.

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
kooifong.lim
Posts: 6
Joined: Fri 4. Nov 2011, 05:51

Re: Display search result on another page

Post by kooifong.lim »

Hi Knut, Great!!

It's working. Thanks so much.

Lim
User avatar
ChristianK
Posts: 22
Joined: Tue 18. Oct 2011, 10:29

Re: Display search result on another page

Post by ChristianK »

Hello Knut,

I have two language-trees to search (en/de), with the CP-Search it is possible to configure where to start with the search (one at home_de and one at home_en).
Is it possible to use the method above with limiting the search for one language-tree?

best regards
Christian
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Display search result on another page

Post by flip-flop »

Create two different search CPs in two article or categories e.g. search_en and search_de.

And then do

Code: Select all

<form action="index.php?search_en" .....
<form action="index.php?search_de" .....
Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
ChristianK
Posts: 22
Joined: Tue 18. Oct 2011, 10:29

Re: Display search result on another page

Post by ChristianK »

Thanks a lot!

works like a charm :D

Christian
Post Reply