I've got a view with an exposed to users filter criteria ajax search. I want to customize it somehow and link a specific search phrase to a specific node.

any idea on how to do that? any way around without getting my hands dirty with coding?

  1. use hook_form_views_exposed_form_alter(&$form, &$form_state, $form_id)
  2. if ($form['#id'] == 'views-exposed-form-search-page...'
  3. $form['my_link_element'] = array('#markup' => l(t('Seacrh word taken from form_state'),'node/5'));
  • thank you gaydabura, could u elaborate more though on what should I replace on 3? what should 'my_link_element' be? =)
    – Nim
    Jan 12 '13 at 16:42
  • "my_link_element" - internal name of you element on form - can be any you want.
    – Gaydabura
    Jan 14 '13 at 10:49
  • Actually I think you misunderstood my problem. =) I'll try to rephrase. I give the possibility to the users to search and find a node via this view search filter. What I want to achieve is that if they search "/help", for example, the only result to be a specific node that I've made. So: I want a relationship between a specific search phrase and a node somehow.
    – Nim
    Jan 24 '13 at 14:29

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.