I like to be able to theme the advanced search so that the proximity search with the googlemap is the main way of searching. Rather then tucked away under the options as it currently is.
Are there any pointers for doing this or modules/ views recipes that exist or do I just have to play with the node overrides?
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | advanced_search_uncollapsed.zip | 1.13 KB | dianacastillo |
Comments
Comment #1
rooby commentedUse hook_form_alter(&$form, &$form_state, $form_id)
For an example see the location_search modules location_search_form_alter(), which is where the advanced form is added to the search form.
You could do things like:
Comment #3
dianacastillo commentedi put this in my template.php in my theme
function search_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'search_form' ) {
if (isset($form['advanced'])) {
// Uncollapse fieldset by default.
$form['advanced']['#collapsed'] = FALSE;
// Move the fieldset to the top.
$form['advanced']['#weight'] = -10;
}
}
}
and it doesnt change anything, the advanced search is still collapsed. I put the them name instead of search that doesn work either
Is there somewhere else I'm supposed to put it?
thank you
Comment #4
rooby commentedThe hook_form_alter function should go into a custom module.
For example, you create a module called my_search_customisations (you can call it something better I'm sure).
Then in that module you have
If you are unfamiliar with creating modules there is mush info on it at http://drupal.org/node/206753
Comment #5
dianacastillo commentedokay, i made a module which does this, I am attaching it. how can I publish this so other people can use it?
Comment #6
rooby commentedIf you go to your account profile page there is a tab called "Your projects".
If you go there there will be a list of your existing projects and a link to add one.
You can add a sandbox project there.
Then you can refer people to that sandbox.
If you want to can also promote it to a full project. To do this you first have to have it approved by posting a project application issue at http://drupal.org/project/projectapplications
There is more detailed information at http://drupal.org/node/1011196 and its sub-pages.