Search result in content area

Permalink
I'm (still) looking for a way to get my search results in the contentarea. The search input box is the header-div, and that's where the results show up.

Is there an addon that does this?

Hoping for some good tips. Thanks,
Martijn

pixel
 
jero replied on at Permalink Reply
jero
You need to do a few things:

1) The header search block needs to "Post to Another Page Elsewhere"

2) Set up a search results page, and make sure this is the target of (1)

3) The header search will still show the results, if it's present in the header of every page. The way I get around this is to use a css rule that targets the <div class="searchResult"> that surround each results adding display:none so they don't show. Alternatively, you create yourself a new template for the search block in the header that doesn't show the results at all.
prestressed replied on at Permalink Reply
prestressed
This is the most useful post I found:http://www.concrete5.org/community/forums/customizing_c5/search-box...

If you first make a single separate page with the URL /search and put the search block on that, that's where the results go. You can do a custom template for the block if you want to make it prettier.

Then add a form - NOT a search block - on the pages where you actually want the 'Search this site' box (hardcode it in the template, or add as an html block/stack or whatever suits you)

Mine looks like this:
<div id="search">
<form method="get" action="<?php echo $this->url('/search') ?>">
   <input type="text" id="search-keywords" name="query" value="Search site for..."/>
   <input type="submit" id="search-go" name="go" value="Go"/>
</form>
</div>


Seems you can add <fieldset> tags within the <form> tags if validation is an issue. And of course you can add CSS classes or whatever you like to your form for styling.

All credit to Jordan Lev for this answer
frz replied on at Permalink Best Answer Reply
frz
add two search blocks.

1) Add a search block to an empty page in the main content area. Call this empty page /search_results (or whatever you'd like) but this is where search will point to.

2) Add a search block to the page defaults where you'd like the search field to be, typically in a header or footer something. From the settings in that search block you can choose to point it's results to another page. Pick the page you made for results.

The #2 search block will find the #1 search block on that target page and use it to display the results in whatever block area you put it in.
pixel replied on at Permalink Reply
pixel
Thank you all! Finally got the picture ;)
designaroni replied on at Permalink Reply
designaroni
@frz/anyone else,

I did step 2 then step 1 without knowing there should be an order to how you create the search elements - I was getting results in both areas, then I deleted them and remade them how you described (not hard at all) but I am still getting search results returned under each element. Is this a result of creating them incorrectly the first time?

In the mean time I am using css to hide the results that display in the header but that seems backwards, is there a simple solution to this?
lvillarejo replied on at Permalink Reply
I have the same problem and also wonder for an alternative solution.

Thanks
designaroni replied on at Permalink Reply
designaroni
Did you try using some CSS to hide the unwanted results?
Steevb replied on at Permalink Reply
Steevb
I used prestressed link:http://www.concrete5.org/community/forums/customizing_c5/search-box...

jordanlev's solution worked perfectly.
lvillarejo replied on at Permalink Reply
Hi, thanks for the replies,

I didn't want to use CSS to hide the results, instead I used the following solution and it worked nicely:

http://www.concrete5.org/community/forums/themes/search-box-duplica...

Best,
Luis