I'm trying to append html/javascript to the formatted output of fields of random views (view setup unknown, just known that they use fields). The usage of the result array does not fit since it should not add any additional html (and it does not work with file/image field either). An approach is to use the alter array in the display object:
function testmodule_views_pre_view(&$view) {
// Test with image field of display default.
$view->display['default']->display_options['fields']['field_image_fid']['alter']['make_link'] = 1;
$view->display['default']->display_options['fields']['field_image_fid']['alter']['path'] = 'testpath';
$view->display['default']->display_options['fields']['field_image_fid']['alter']['suffix'] = 'SUFFIX';
$view->display['default']->display_options['fields']['field_image_fid']['alter']['suffix'] = 'PREFIX';
}
so the object is altered as I've had set this in the view itself. However the view does not seem to use this altered object for rendering though the assignment of this values was successful (tested with print in the other hooks -> also the recursed objects contain the altered values). What object does views use to generate its rendered output then?
Or is there another way to alter the formatted output of view fields when loading a view?
Comments
Comment #1
esmerel commentedNo activity for 6 months