In the docs for hook_view_pre_render http://api.drupal.org/api/views/views.api.php/function/hook_views_pre_render/7 it states "Altering the content can be achieved by editing the items of $view->result."

Removing elements from this array is reflected in the final output, but appending to it, rewriting parts of it, or reordering it results in no change to the final output.

Does anyone know what's going on? How do I use this hook to alter or add to the results of the view post-query but before rendering?

1 Answer 1


Don't know what the deal was with hook_views_pre_render, but adding to the result array works fine in hook_views_post_execute, and accomplishes the same thing.

  • I've been searching for this the whole day! this works!
    – FLY
    Commented Apr 23, 2013 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.