How can I set default value (prepopulate) for field in views exposed filter?

How can I set default value (prepopulate) for field in views exposed filter?

I’ve tried to use solution from Can I prepopulate an exposed filter text field? but failed. Cache clearing does not help.

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == "views_exposed_form" && $form['#id'] == "views-exposed-form-test-populate-page" ) {
    $form['title']['#default_value'] = 'test title';
    dpm($form);
  }
}

How can I set default value (prepopulate) for field in views exposed filter?


Go to Source of this post
Author Of this post: Dimetry
Title Of post: How can I set default value (prepopulate) for field in views exposed filter?
Author Link: {authorlink}