0

I have a view with an exposed filter with taxonomy tree. Each term can be selected or unselected. If some parent term is selected but every of its child terms isn't selected then all the children terms also should be added to view filter.

But if I select one children term after it, the view should be filtered only by this children term (not by all children terms).

I decided to solve this problem trying to add children terms in the view parameters. By my idea, the view should use this parameters for its execution.

But, unfortunately, I can't understand where to add these params. I tried to use different view hooks, having tried to add them in vars $view->exposed_data, $view->exposed_raw_input, $view->exposed_input. No result.

I also tried to add them in the submit function of the exposed filters form. No positive result also.

Could you clarify me, where can I add new params into the view ?

For example, a user selected term1. In this case term2 and term3 should be added to the view parameters programmatically. And after it, views should use parameters term1, term2 and term3.

I hope, I've described the problem clearly

1 Answer 1

0

I solved a similar issue using hook_views_pre_render(&$views).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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