In my theme, I needed to move the submit button down by about 20px using margin-top. To do this, I added an '#id' value to the submit array in apachesolr_search.pages.inc:

function apachesolr_search_custom_page_search_form($form, &$form_state, $search_page, $keys = '') {
. . .
  $form['basic']['submit'] = array(
    '#type' => 'submit',
    '#id' => 'solr',
    '#value' => t('Search'),
  );  

This allowed me to define the CSS for this button by calling input#solr in my themes stylesheets.

Not sure if we would want to add this permanently, but at least it might be helpful for someone else in the future.

Regards,
James

Comments

Nick_vh’s picture

Status: Active » Closed (works as designed)

Please alter this in a hook_form_alter. This is something that doesn't require a lot of coding. Unless the consensus of many others would be to add an id here, I prefer not to touch it. I assume many others have done this in a hook_form_alter already.

orange-wedge’s picture

Thank you for suggesting hook_form_alter(). I prefer that approach too. I wasn't aware of that hook. Sorry to add a non-issue.

This hook worked:

function mymodule_form_alter(&$form, &$form_state, $form_id) {
    if($form_id=="apachesolr_search_custom_page_search_form"){
        $form['basic']['submit'] = array(
            '#type' => 'submit',
            '#id' => 'solr',
            '#value' => t('Search'),
        );  
    }   
}