0

My question is ,I have a views named for sale and it is exposed with some fields . I have created other 2 instances of this view using override this feature of views now I want to alter all three views seperately , for this i have used form alter but I am not getting the seperate ids for delta nor the #id for those .how can i alter those delta .

1

You can achieve this goal via implementing hook_form_alter

Let e.g.

/**
 * Implements hook_form_alter().
 */
function MYMODULE_form_alter(&$form, &$form_state, $form_id) {

    if ($form_id == 'views_exposed_form' && $form_state['view']->name == 'test' && $form_state['view']->current_display == 'page_1') {
       // do your alteration stuff
    }
    if ($form_id == 'views_exposed_form' && $form_state['view']->name == 'test' && $form_state['view']->current_display == 'page_2') {
       // do your alteration stuff 
    }
}
  • @harsh If it works, Please approve this answer. so that it would disappear from unanswered list, and also useful for future readers. – Krishna Mohan Sep 2 '14 at 5:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.