0

Is there a hook in the views api that allows for accessing the $view object of each result row after submitting exposed filter values in an ajax-enabled view block? I need to override the field output of an ajax-filtered view.

I need something similar to hook_views_pre_render which works great to override fields in a view that doesn't use ajax/exposed filters, but it doesn't work for ajax-reloaded view blocks generated by exposed filter input.

  • Whats your requirement? You want to add any particular class or an additional element with each row? – ARUN Nov 14 '13 at 9:19
  • yes - that would be great - I actually want to show/hide fields for each view row based on field values for that row as well as check against the logged-in user's roles – zopa Nov 14 '13 at 12:30
  • Try this module drupal.org/project/views_customfield. By using this module you can add php field in view. In the field settings you will get the views row object and then you can display the value based on particular condition there. – ARUN Nov 14 '13 at 12:54
  • I tried Views PHP (which is the successor to Views Custom Field). I have so many fields that I need to hide/show based on certain conditions that it got unwieldy and ugly. Which is why I'm exploring a custom module with views hooks or overriding the views template. It's the ajax loaded view that's killing me - I can't figure out how to access the $view array of each row after submitting exposed filter values. – zopa Nov 14 '13 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.