There is some way to somehow, make the "Search form" block to use (redirect it) my new "search page" (already filtered with the bundle:book) ?
It seems that the default action for the Search form block is to search on /search/site, and i would like, in certain site sections, make it search on /search/docs (as i named it...)
Comments
Comment #1
nick_vhWould a possible solution be a configuration option in the search block asking to what page you want to submit it to?
If you want to do it yourself you should probably write a submit handler for the search form and reset the redirect there
my_module_form_search_submit()
Comment #2
nick_vhThis should work,
Comment #3
nick_vhComment #5
drewmacphee commentedWouldn't it be better for each search page to have it's own search form block?
Comment #6
nick_vhYes it would be,
but we are in search of people that would love to create this functionality. Are you interested? :-)
Comment #7
mtift@Nick_vh I would be interested in help with this. Do you have a general idea about how you would like it to work?
Comment #8
nick_vhThere is a tab search pages/blocks.
I'd love to see this decoupled and an easy way to manage search blocks/clone search blocks in the same manner as possible with the more like this block. However, we do not aim to replicate "views" alike blocks so the specs of each block should be well defined
For now we can start with making the search block a bit more dynamic and then hook into this cleaner function to make different versions of them
Comment #9
nick_vhThis is already implemented in 6.x-3.x. It could be as simple as a small config in the settings tab
Comment #10
tobi20 commentedI would like to help with this. Is this just a port of 6.x-3.x to 7.x-1.x? Any ideas where I should start?
Comment #11
nick_vhtobi, yes you could try to do something similar?
Let us know how you are progressing! Thanks
Comment #12
luco commentedhey there,
has any progress been made in this regard?
cheers,
Luciano
Comment #13
luco commentedhey there,
I've studied your code from versions 6.x-3.x and 7.x-1.x and ported that functionality. please test the patch.
I realise it's not the decoupling - yet! - but at least users can have a choice of search page redirection. ;)
cheers,
Luciano
Comment #14
Daniel Schaefer commentedThanks a million, luco. Works like charme on my D7
Comment #15
luco commentedglad to hear! :) not sure this contribution is what the maintainers are after, but let's hope it gets incorporated.
Comment #16
subhojit777I tested the patch submitted in #13. It is working alright when I select Core Search or a custom search page. However, there is some error when I select drupal core search. On selecting drupal core search I am getting page not found and an error:
Comment #17
subhojit777@luco I saw your patch, in apachesolr_search.admin.inc you are doing:
$options['drupal_core'] = t('Drupal Core Search');Is this necessary? You can configure default search from admin/config/search/settings, so I guess Drupal core search option is not necessary in the admin form.
Comment #18
subhojit777@luco I have made certain changes to your patch. I am removing this option:
$options['drupal_core'] = t('Drupal Core Search');because I think it is not necessary, and a similar setting already exists in default drupal search.
Comment #19
subhojit777Very sorry. Patch not uploaded correctly. Uploading it again.
Comment #20
nick_vhneeds a docblock above the function
Why not a select list? This could grow extensively if there are many pages?
drupal_core is not a valid default search page, Better would be to take the first one from the list with a preference for drupal_core. I think we'll make it possible soon to remove that one page. A little further you use the variable to define this default page with the apachesolr_search_default_search_page() function.
Description is not super clear, can you improve this?
Can you add some documentation here?