Assume that I'weI've created a view that outputs a list of cars. For each car, I display the name and the age of the car. This is all done with the Drupal UI. Now I'd like to add a simple button (Set as favorite) at the end of each line that when clicked saves the ID of the chosen car in a user's session variable. So my view table should look like the following:
Name Age Button
car1 23 'set as favorite'
car2 10 'set as favorite'
I am not asking about the session-variable part, but only how I can alter the view output to add a simple button to each row of the list output (I bet it'll be a form in each row) to each row of the list output.
I've done a lot of reading and I bet this could be done with hook_views_data_alter
or some other hook_views_*
but I'm not proceeding. I've already tried drop-buttons as suggested on Add custom action buttons to a view, but that does not solve the things I need. I need the car's ID I want to save in a session variable, so basically I need a form functionality.