0

I have a view with some better exposed filter and I'd like to add the count of items for each filter like this (but without using facets) :

Term 1 (7) - Term 2 (5) - Term 3 (8) ...

I saw this solution but, I'd prefer using the query directly from my view or better using the view itself.

The problem is that inside a hook_form_alter(), every function related to this view (like views_get_view_result()) crashes Apache.

function mymodule_form_views_exposed_form_alter(&$form, &$form_state, $form_id) {
  if ($form['#id'] == 'views-exposed-form-my-view-page') {
    $v = views_get_view_result('my_view', 'page');
    dpm($v);
  }
}

Any better idea for accomplishing this ?

2

0

Your Answer

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

Browse other questions tagged or ask your own question.