Posted by wodenx on November 19, 2010 at 1:43pm
Hello again,
I'm wondering if there's any way to specify one custom field handler as the parent of another. In other words, I have a field handler in one module that extends views_handler_field_prerender_list. Now I'd like to implement a handler in another module that does much of the same processing with a small differrence - so i'd like it to extend my original handler. I'm not clear enough on the way Views handles code loading to know the best way to do this. Can I simply do
module_B_views_handlers() {
return array(
'info' => array(
'path' => drupal_get_path('module', 'module_B') .'/views',
),
'handlers' => array(
'module_B_field_handler' => array(
'parent' => 'module_A_field_handler',
),
),
);
}Seems unlikely, because how would Views know where to find the original handler?
Or, should I just include the code for the original handler in my new handler, and specify the same parent in HOOK_views_handlers?
Thanks
Comments
bump. anyone?
bump. anyone?
Did you try this? It should
Did you try this? It should totally work. Views handles the parentage just fine as long as module_A exists. In D7, you don't even need to specify the parent, because of D7's class registry.
Thanks - yes, it works
Thanks - yes, it works perfectly.