I am trying to modify a view before its rendered. I have a page with two view blocks on it. I have the following code in my template.php:

function isn3_preprocess_views_view (&$vars) {
  drupal_set_message('Hey', 'status');

function isn3_views_pre_render(&$view) {
  drupal_set_message('Ho', 'status');

However when I visit the page, each function only gets called once, despite there being two views on the page. Is there any reason that a view wouldn't run through either of those functions?

  • Is that the code of a theme, or a module?
    – apaderno
    Nov 14, 2012 at 23:28
  • That code is running in the tempalte.php of the theme, named 'isn3' however I have also added the hook_views_pre_render() to a module and get the same issue. Odd thing is that I cleared the cache, then reloaded, and I saw all three function being hit by both views, but when I reloaded again, it just shows one. Could this be some sort of caching issue? Nov 14, 2012 at 23:50
  • which version you are using?
    – monymirza
    Nov 15, 2012 at 6:30


Your Answer

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

Browse other questions tagged or ask your own question.