-2

I have a relationship in my view to the content group content, and then I put in an exposed filter for the parent group. But the exposed filter works with the id of the group, I want it to work with a drop down of the name of the group .

How can I achieve this?

enter image description here

  • If you have the Relationship to that Group you probably have the Filter for the Group name, use the name filter instead of the ID filter. – prkos Aug 26 at 18:24
  • hi I would love to do what you mention here but I don't see that filter (name filter) anywhere. The choices for the filter criteria is only "Parent Group" which works with the id , it doesn't work with the name. please tell me where I can change this . thanks – Diana Aug 26 at 18:37
  • Is there an option in that filter to use a Relationship? Are you sure you have added the Relationship to the Parent Group? Maybe you need to add one more Relationship if the first one is for content, the second one should be for the Parent. – prkos Aug 26 at 18:46
  • the only choice for relationship that I can use is "Content group content" – Diana Aug 26 at 19:02
-2

I made a custom hook form alter: getting the names from a query of the group (Didn’t have space here to put that )

 if ($form_id == "views_exposed_form"){
     if ($form['gid']){
       $terms = (0=>firstname, 1=>secondname etc)
       $x = 1;
       foreach ($terms as $term) {
         $options[$x] = $term->name;
         $x++;
       }
       unset($form['gid']);
       $form['gid'] = array(
        '#type' => 'select',
        '#options' => $options,
        '#title' => t('State'),
       ); 
      }   
     }

Your Answer

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

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