1

I have a views block displayed on a page. It has simple hierarchical select exposed filter field to which i want to set default value when the page loads. I have written below code in hook_form_alter but it does not work.

$form_state->setUserInput(['tid' => '47']);

When i check in preview section of views my taxonomy is selected and works perfectly but on page it does not work.

Thank's in advance

Your Answer

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

Browse other questions tagged or ask your own question.