Skip to content
Snippets Groups Projects
Commit a63427b8 authored by Brian Canini's avatar Brian Canini
Browse files

asc_bootstrap - theme hooks for research ct filters

parent 254df117
No related merge requests found
......@@ -70,7 +70,7 @@ function asc_bootstrap_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $
/*
* events and news filters
*/
if (($form['#id'] == 'views-exposed-form-events-page-1')||($form['#id'] == 'views-exposed-form-news-page-1')) {
if (($form['#id'] == 'views-exposed-form-events-page-1')||($form['#id'] == 'views-exposed-form-news-page-1')||($form['#id'] == 'views-exposed-form-research-project-directory-page-1')) {
/*
* add new HTML content to filters (headers and spacer)
* and setting weights for where they should appear in the form hierarchy
......@@ -117,6 +117,32 @@ function asc_bootstrap_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $
if(count($form['field_news_terms_2_target_id']['#options']) == 1) {
$form['field_news_terms_2_target_id']['#access'] = FALSE;
}
if(count($form['field_research_departments_target_id']['#options']) == 1) {
$form['field_research_departments_target_id']['#access'] = FALSE;
}
if(count($form['field_research_other_target_id']['#options']) == 1) {
$form['field_research_other_target_id']['#access'] = FALSE;
}
if(count($form['field_research_year_target_id']['#options']) == 1) {
$form['field_research_year_target_id']['#access'] = FALSE;
}
/*
* research filters - setting default value on select box to taxonomy vocabulary
*/
if(count($form['field_research_departments_target_id']['#options']['#value']) == "All") {
$form['field_research_departments_target_id']['#options']['All'] = $form['#info']['filter-field_research_departments_target_id']['label'];
}
if(count($form['field_research_other_target_id']['#options']['#value']) == "All") {
$form['field_research_other_target_id']['#options']['All'] = $form['#info']['filter-field_research_other_target_id']['label'];
}
if(count($form['field_research_year_target_id']['#options']['#value']) == "All") {
$form['field_research_year_target_id']['#options']['All'] = $form['#info']['filter-field_research_year_target_id']['label'];
}
}
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment