Question

I can only find docs for predefined handlers. I guess I would have to override one of the handler classes, but which methods do I actually have to override? I read somewhere that new handler for Views 2 need to be registered with Views. Where and how?

I want to define a field which is not a DB field, but a field calculated from other fields (a countdown to a future date/time).

Edit: I am talking about a custom module which already has two Views 2 fields (two time stamps). Now I want to define two more fields which are not really DB fields, but calculated from the real fields. So we are talking about hook_views_data() here. I don't want to define a concrete field for a concrete view, but the definition of a field which can be used by the user of the module for arbitrary view.

The question is, how are such fields defined? If I declare the field as notafield and set a nonstandard handler function I get an error in the views config GUI Broken/missing handler. I can guess from the views code, that I probably need to override one of the predefined handler classes (as opposed to global functions as with views 1). But which of the methods do I need to override and where do I put the new class and how does views know where to find the class? I can't find any documentation for custom field handler or query handlers.

Edit:
I documented the whole thing here.

Was it helpful?

Solution 2

I figured it out (actually the nice folks at the dev list did): The documentation is in the advanced help. Just install views and the advanced help module.

OTHER TIPS

The module "views_customfield" can be used to create custom field for views.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top