By forward-media on
Hello everybody, ...
i program a modul where the user can input some keywords in an input field and if he clicks on "search", the results will be shown. So my problem now is, how do i say that the input field and the button is in the top_block of the site and when he clicks on "search" the result are shown in the content_block.
maybe its very easy, but i'm new in drupal and don't know exactly how all of drupal works, ...
toby,
"sorry for my bad english! :-)"
Comments
/
What the problem?
update.php try...
hook_block and drupal_goto
I'm going to use a bunch of terms that you will want to search for in Drupal, but the procedure below seems sound to me.
You can use hook_block to create the block code, then allow the user to place it wherever they want (including the header region). Then when the user clicks submit, your submit handler constructs a url like 'search/your/search/terms' and this url is inserted as the single argument in drupal_goto(), and you use hook_menu to create a callback for the 'search' terms.
In your callback function you use the 'function_get_args()' (or whatever it is called) function to find out what arguments your callback was called with, and it will return an array like so:
since the additional parts of the url are passed to the callback function.
In your callback you can use the search terms to display whatever content you want.
Dave
My site: http://www.unitorganizer.com/myblog