I am working on a view that is displayed in tabular form, with multiple fields from the node. At the end of each row I want to build a dropdown that has a half-dozen links from it, with each link generated by my custom module, based upon the value in one of the node's fields. I want to use the same code on a few slightly different tabular views. So I guess I am looking at building a handler or a plugin? Which is it? And where do I find a good tutorial for this? I have tried to mash something together, mimicing other modules, but get missing handler errors...

Most helpful answers

Yup, Laryn's approach is the simplest way to build dropbuttons with links. No need to write a handler in that case.

I may not be fully understanding, but if it's a View that is displaying fields in a table, you may be able to use the default "Global: Dropbutton" field in the final column of the table, and build customized links using the "Nid" field to populate the dropbutton:

From your description, it looks like you need a handler (not a plugin). Handlers are simply classes that provide functionality for Views fields, Views filters, Views sorts and Views relationships. Those handlers hae to be defined defined in hook_views_data() or hook_views_data_alter(). Plugins are broader code used for things like theming the output into specific displays, or providing access callbacks for the View, etc. 

The missing handler errors are due to the fact that you need to be sure to include the class and its location in hook_autoload_info(), so that the handler definition can load the class when it's needed.

There are no really good full tutorials on how to write Views handlers. In the past I've used 3 or 4 partial tutorials found online by doing searches, and have also looked at handlers provided by contrib modules. I've gotten pretty good at writing those. Take a look at UC Attribute Views, which contains several handlers I adapted or wrote myself. 

If you want to post your code so far here I can take a look.

Comments

From your description, it looks like you need a handler (not a plugin). Handlers are simply classes that provide functionality for Views fields, Views filters, Views sorts and Views relationships. Those handlers hae to be defined defined in hook_views_data() or hook_views_data_alter(). Plugins are broader code used for things like theming the output into specific displays, or providing access callbacks for the View, etc. 

The missing handler errors are due to the fact that you need to be sure to include the class and its location in hook_autoload_info(), so that the handler definition can load the class when it's needed.

There are no really good full tutorials on how to write Views handlers. In the past I've used 3 or 4 partial tutorials found online by doing searches, and have also looked at handlers provided by contrib modules. I've gotten pretty good at writing those. Take a look at UC Attribute Views, which contains several handlers I adapted or wrote myself. 

If you want to post your code so far here I can take a look.

I may not be fully understanding, but if it's a View that is displaying fields in a table, you may be able to use the default "Global: Dropbutton" field in the final column of the table, and build customized links using the "Nid" field to populate the dropbutton:

Yup, Laryn's approach is the simplest way to build dropbuttons with links. No need to write a handler in that case.

Thanks guys, yes, I have built a partially functional dropbutton using the Global: Dropbutton feature, but it has no way to control it's logic, and the classes are not applying for some reason...

Each node is an Application. Each Application has a Status (taxonomy) that needs to be set via this dropbutton. But if the Status is already "Awaiting" (tid 515) then I don't want the user to see that as an option in the dropdown, so would remove it via code, and instead the  Status "Processing" (tid 516) would be the first in the list. Each status has a consistent color coding in CSS to make it more recognisable also. So thanks, will check out UC Attribute Views.

Have you tried Editable Views (https://github.com/backdrop-contrib/editableviews)?

That module will allow you to expose the Status widget within the view, and adds a "Save" button to the view. Perhaps not perfect, but an efficient way to provide the form element in the view. You could use a Select widget for the Status taxonomy.