0

I need to add extra parameter at the end of the page view URL when "apply" button of exposed filter is clicked.

For example,

normally URL looks like:

my-view?nid=1

But I need to add "my_parameter=1" at the end of the URL and it eventually needs to be:

my-view?nid=1&my_parameter=1

How can I do this?

1

You can use a hook_form_FORM_ID_alter() to add a hidden form element with the value that you want (1 in your example). You'll have to check the View name and display name to ensure you only affect the right exposed filter.

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.