I'm using Drupal 7 and views 3.0-rc1..

I need to add a field to "content" type views which will display a button along with each node of the view.. I could not find any documentation as on how to implement the same.. Is it true that only if you add relationship with my module, can you see that field in the list of fields? I'll keep on trying to figure out a way but just in case, someone has already done that, please share some insight..

Also, what are the things that I need to be careful of, while the view is being added, edited or deleted..

Comments

bojanz’s picture

Status: Active » Fixed

Your description doesn't provide enough information.
What is a button?
A) Is it a link leading somewhere?
B) Is it an image?
C) Is it a form button that when clicked submits the form and expects something to happen?

For all three, you implement a custom views field handler in your module, and then implement hook_views_data_alter() in your module to add it to the node fields (so that it's visible in the UI).
For C, you need to implement the Views Form API.

There's documentation about all this in the Advanced Help (install the advanced help module and browse it from your drupal install).
For Views Form there are also issues in the queue with example code and additional help.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.