Created
July 9, 2013 23:08
-
-
Save aliciaduffy/5962141 to your computer and use it in GitHub Desktop.
For hiding/showing fields based on exposed filter setting.
This file contains 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
function MYMODULE_views_views_post_build(&$view) { | |
if ($view->name == 'views_name') { | |
if (isset($view->exposed_input['field_geofield_distance'])) { | |
if (isset($view->field['field_geofield_distance'])) { | |
$view->field['field_geofield_distance']->options['exclude'] = TRUE; | |
} | |
} else { | |
if (isset($view->field['field_geofield_distance_1'])) { | |
$view->field['field_geofield_distance_1']->options['exclude'] = TRUE; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment