How do I add a form to a view with drupal 6.x views 2?
-
04-07-2019 - |
Question
I want to add a drupal form to the top of a view. The view does not need to receive the results of the form but the _submit hook of the form should be able to read the first argument of the view that the form was on.
Where is the best place to add this? Custom module or template file and what are the necessary filenames/hooks?
Solution
It appears the hook you want is
_views_pre_view
with variables $view, $display_id, $args and you want to set $view->attachment_before to equal the form.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow