Search Post to Another Page
Permalink
I need to send my search results to another page... this seems not to be working. I selected this in the edit of the search block, and told it to use the search page... still will not work. Can someone help me out here?
what does not work mean? i click search and it sends me to index.phpSearch
where did you point it? I pointed the results page to Search, a page i created but I am unsure what to add to that page to let it know it is to host results.
what are you seeing? nada...
where did you point it? I pointed the results page to Search, a page i created but I am unsure what to add to that page to let it know it is to host results.
what are you seeing? nada...
I think this post solves his problem, but is there going to be away to just specify this is where i want my search results. Without having double search boxes.
http://www.concrete5.org/community/forums/customizing_c5/search_blo...
http://www.concrete5.org/community/forums/customizing_c5/search_blo...
I was playing around with a similar setup, and wanted to remove the search box on the Results page.
I created a custom template and applied it to the search block on the Result page.
I attached it for you to have a look at. I made some other changes as well, formatting etc.
Don't know if this is a good solution, but it works. If you have any comments (like UR DOIN IT WRONG!) please let me know! It's the only way I'll learn!
I created a custom template and applied it to the search block on the Result page.
I attached it for you to have a look at. I made some other changes as well, formatting etc.
Don't know if this is a good solution, but it works. If you have any comments (like UR DOIN IT WRONG!) please let me know! It's the only way I'll learn!
Matt,
Basically, if you set up a page for the results to post to (let's say your page alias is search-results) then in the text field under "Post to Another Page Elsewhere" you need to type in /search-results. (the / needs to be in there) Then on the search-results page you need to add a search block also.
Now, to me this could work a little better. How would anyone know they need to add the / before the page and to add a search box to the page you want the results to show on. As I mentioned here (http://www.concrete5.org/community/features/add_page_picker_to_image_block#7941) there should be a page picker to pick what page you want to display results to and you shouldnt have to manually add another search box to the results page (maybe it should do it automatically or there should be a little message that tells you to add it or something).
Basically, if you set up a page for the results to post to (let's say your page alias is search-results) then in the text field under "Post to Another Page Elsewhere" you need to type in /search-results. (the / needs to be in there) Then on the search-results page you need to add a search block also.
Now, to me this could work a little better. How would anyone know they need to add the / before the page and to add a search box to the page you want the results to show on. As I mentioned here (http://www.concrete5.org/community/features/add_page_picker_to_image_block#7941) there should be a page picker to pick what page you want to display results to and you shouldnt have to manually add another search box to the results page (maybe it should do it automatically or there should be a little message that tells you to add it or something).
There are probably lots of useful notes in the attached threads, but I'll add some to this thread too:
When you want to use the search block to search on a separate page, what you'll need to do is create another search block, on the target page.
1. Create the search block on the target page, first. Take note of the path of that page. e.g. - I've created a search results page off the root, and it's path is "index.php/search_results/"
2. Add a new search block to the page you actually want search to display on. click the "post to other page" checkbox, and add the path, without the index.php, to the input element.
So, I add "/search_results" as the page I'd like to post to.
That should be all it takes to get it posting from the first page to the second. Now, to actually remove the input element, you will have to modify the search template. Copy the concrete/blocks/search/view.php page to blocks/search/templates/results_only.php. Then, open results_only.php and remove the search input field.
Now, go to your target page, edit the block, select "choose custom template" and you should see "Results Only" as a template. Select that. Now, your first search block should show up with an element, but the results never will.
When you want to use the search block to search on a separate page, what you'll need to do is create another search block, on the target page.
1. Create the search block on the target page, first. Take note of the path of that page. e.g. - I've created a search results page off the root, and it's path is "index.php/search_results/"
2. Add a new search block to the page you actually want search to display on. click the "post to other page" checkbox, and add the path, without the index.php, to the input element.
So, I add "/search_results" as the page I'd like to post to.
That should be all it takes to get it posting from the first page to the second. Now, to actually remove the input element, you will have to modify the search template. Copy the concrete/blocks/search/view.php page to blocks/search/templates/results_only.php. Then, open results_only.php and remove the search input field.
Now, go to your target page, edit the block, select "choose custom template" and you should see "Results Only" as a template. Select that. Now, your first search block should show up with an element, but the results never will.
I've done everything you said.
3 Times, without luck.
I removed, re-added, no luck.
my steps were:
0. create /suche and add a search block
1. add search block to start page
2. direct results to /suche
3. set it up to search everywhere.
4. run the jobs several times.
5. no luck! it won't spit anything except page aliases.
Any ideas?
Can it have something to do with my template?
I use following code for content, and it works.
The Database doesn't contain anyything in the of the except the welcome text of concrete5.
I've many pages and every page has content.
Nothing of it is in the pagesearchindex table's content field.
I appreciate any help.
3 Times, without luck.
I removed, re-added, no luck.
my steps were:
0. create /suche and add a search block
1. add search block to start page
2. direct results to /suche
3. set it up to search everywhere.
4. run the jobs several times.
5. no luck! it won't spit anything except page aliases.
Any ideas?
Can it have something to do with my template?
I use following code for content, and it works.
<?php if($_SESSION['lang'] == 'en'){ $inhalt_en = new Area('Content'); $inhalt_en->display($c); } else { $inhalt_de = new Area('Inhalt');$inhalt_de->display($c); } ?>
The Database doesn't contain anyything in the
"content" field
"pagesearchindex" table
I've many pages and every page has content.
Nothing of it is in the pagesearchindex table's content field.
I appreciate any help.
Do I need a special php extension for the search?
well depends on the version of concrete5 you're running, but if its 5.3.2 no..
of course, it may depress you to learn, we're rethinking search again.
of course, it may depress you to learn, we're rethinking search again.
If you're naming your areas something other than Main then the search system needs to be modified to search additional areas for content.
Override the index_search.php file from /concrete/jobs/index_search.php by copying it to /jobs/index_search.php
Then modify the run function to look like this:
Override the index_search.php file from /concrete/jobs/index_search.php by copying it to /jobs/index_search.php
Then modify the run function to look like this:
<?php public function run() { Loader::library('database_indexed_search'); $is = new IndexedSearch(); // specify additional areas to search $is->addSearchableArea("Content"); $result = $is->reindex(GUEST_GROUP_ID); return t('%s page(s) indexed.', $result->count); }
I've modified the search to do lookups for DE/EN dependant on the language we are in.
So the problem is obvious, there is only one column in the database in the search block's table called "content". Which is not enough!
I have 3 content areas, the content are description changes automatically by the language of the user, or by the hit of a flag.
Basicall this are 6 content areas in total.
Area("Main Content")..
Area("Haupt Inhalt")..
Area("Sidebar")..
Area("Seiten-Navigation")..
And so on.
I would love to see a solution to this, now that you have the power of switching the lanuage too. :)
cheers!
So the problem is obvious, there is only one column in the database in the search block's table called "content". Which is not enough!
I have 3 content areas, the content are description changes automatically by the language of the user, or by the hit of a flag.
Basicall this are 6 content areas in total.
Area("Main Content")..
Area("Haupt Inhalt")..
Area("Sidebar")..
Area("Seiten-Navigation")..
And so on.
I would love to see a solution to this, now that you have the power of switching the lanuage too. :)
cheers!
I have a related issue...
I've added a 'search' field in the header of every page on my site. It's set up to point to a search-results page, and it works great, except: the search results display in the main content section of the page (where the search results box is added), AND also in the header.
I created another template for the header search box and deleted PHP code that returns results.
I'm sure there's a more elegant way to do this, but it sure works for me. The results display beautifully in the results page now, and no results appear in the header search box.
I've added a 'search' field in the header of every page on my site. It's set up to point to a search-results page, and it works great, except: the search results display in the main content section of the page (where the search results box is added), AND also in the header.
I created another template for the header search box and deleted PHP code that returns results.
I'm sure there's a more elegant way to do this, but it sure works for me. The results display beautifully in the results page now, and no results appear in the header search box.
try hard coding it, it works fine for me
where did you point it?
what are you seeing?
gimmmie details.