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

asc_bootstrap - adding hook_form_alter for news filter

parent dade2eca
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,10 @@ function asc_bootstrap_preprocess_block(&$vars) {
* alters news and events filters so that AJAX doesn't remove headings, etc. upon request
*/
function asc_bootstrap_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
if (($form['#id'] == 'views-exposed-form-events-page-1')||($form['#id'] == '#views-exposed-form-news-page-1')) {
/*
* events and news filters
*/
if (($form['#id'] == 'views-exposed-form-events-page-1')||($form['#id'] == 'views-exposed-form-news-page-1')) {
/*
* add new HTML content to filters (headers and spacer)
* and setting weights for where they should appear in the form hierarchy
......@@ -77,6 +80,7 @@ function asc_bootstrap_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $
* setting up weights for form elements
*/
$form['field_evt_date_range_value']['#weight'] = 1;
$form['end_date']['#weight'] = 1;
$form['field_evt_taxonomy_target_id_1']['#weight'] = 2;
$form['field_evt_taxonomy_target_id']['#weight'] = 3;
$form['keys']['#weight'] = 5;
......
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