Created
September 11, 2015 15:43
-
-
Save labboy0276/66f165e89d5c150ff677 to your computer and use it in GitHub Desktop.
Change contextual filter to a Select list on Pane
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Implements hook_form_FORMID_alter(). | |
| */ | |
| function ccm_publications_form_views_content_views_panes_content_type_edit_form_alter(&$form, &$form_state) { | |
| // Change this out to be a select list. | |
| if (isset($form['arguments']['field_ccm_publication_type_tid'])) { | |
| $v = taxonomy_vocabulary_machine_name_load('ccm_publication_type'); | |
| $terms = taxonomy_get_tree($v->vid); | |
| foreach ($terms as $term) { | |
| $vocab[$term->tid] = $term->name; | |
| } | |
| $form['arguments']['field_ccm_publication_type_tid']['#type'] = 'select'; | |
| $form['arguments']['field_ccm_publication_type_tid']['#options'] = $vocab; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment