i have a view with an exposed term filter. I need to insert other (non-term) values into the select list and programmatically process when one of these fake selections is submitted.
by example:
terms:
Spring 2013
Fall 2013
Winter 2014
Spring 2014
but insert (via form alter):
2013
2014
so i now end up with:
2013
- Spring 2013
- Fall 2013
2014
- Winter 2014
- Spring 2014
tricky part is that if user selects 2014, i will automatically be submitting the tids for Winter 2014 and Spring 2014.
i can use form_alter to modify the select list and:
if i set my exposed filter to accept multiple selections
- then i can use hook_views_pre_build and $_GET['field_term_tid'] = $tids; to set multiple tid vaues and this all works.. :)
but, i need this to be a single select field
- then this no longer works
is there some other views hook that i can use to manipulate this after views has blocked my multiple selections for a single only allowed filter?
Comments
Comment #1
liquidcms CreditAttribution: liquidcms commentedonly way i could figure to do this was to add a #pre_render to the form and manipulate the field parameters there.
so partial code snippets look like this:
the else if part in the pre build is used to set a default value; but this no longer works... likely due to my pre_render code.
Comment #2
ycshen CreditAttribution: ycshen commentedhi,
maybe you can use the following modules to slove your problem :)
https://drupal.org/project/taxonomy_disable_path
https://drupal.org/project/taxonomy_container
https://drupal.org/project/chosen
Comment #3
liquidcms CreditAttribution: liquidcms commentedinteresting modules; but nope, none of those would help.. :)
Comment #4
MustangGB CreditAttribution: MustangGB commented