Search Block
Permalink 1 user found helpful
Quick question regarding the search block. We have added the search to the header of the website pages and would like to have the results appear in the body of a separate page. As noted in the search block features, we have set it to 'post to another page elsewhere' (which works - and takes us to the blank results template page we created). Sooo, now the question we need answered is: what code do we need to place on our Results template page to get the search results to appear?
I believe the search block needs to be placed on your results page. Let me know if I'm wrong.
Thanks!! I would have preferred it without a second search box on the page, but this will work for now!
I know this an older post but I wanted to provide the solution to have a search page with out having double search boxes.
Open:
/concrete/blocks/search/view.php
Replace Line 7 - 21
With:
Add the Following to your Template:
Open:
/concrete/blocks/search/view.php
Replace Line 7 - 21
<form action="<?php echo $this->url( $resultTargetURL )?>" method="get"> <?php if( strlen($title)>0){ ?><h3><?php echo $title?></h3><?php } ?> <?php if(strlen($query)==0){ ?> <input name="search_paths[]" type="hidden" value="<?php echo htmlentities($baseSearchPath, ENT_COMPAT, APP_CHARSET) ?>" /> <?php } else if (is_array($_REQUEST['search_paths'])) { foreach($_REQUEST['search_paths'] as $search_path){ ?> <input name="search_paths[]" type="hidden" value="<?php echo htmlentities($search_path, ENT_COMPAT, APP_CHARSET) ?>" /> <?php } } ?> <input name="query" type="text" value="<?php echo htmlentities($query, ENT_COMPAT, APP_CHARSET)?>" /> <input name="submit" type="submit" value="<?php echo $buttonText?>" />
With:
<?php if( strlen($title)>0){ ?><h1><?php echo $title?> for "<?php echo htmlentities($query, ENT_COMPAT, APP_CHARSET)?>"</h1><?php } ?>
Add the Following to your Template:
<form method="get" action="<?php echo $this->url ('/index.php/search/search-results/'); ?>" class="search"> <input type="hidden" value="" name="search_paths[]"> <input name="query" type="text" value="" > <input type="submit" value="Go" name="submit"> </form>
Cheers dude, this helped me out