Commit 56a347f9 authored by Mike Keran's avatar Mike Keran
Browse files

Issue #2870361 by mikeker: Display exposed sort options as links or radio...

Issue #2870361 by mikeker: Display exposed sort options as links or radio buttons doesn't work if sort order is not exposed
parent 906d2c29
......@@ -146,11 +146,18 @@ class BetterExposedFilters extends InputRequired {
),
),
);
// We can only combine sort order and sort by if both options are exposed.
$bef_options['sort']['advanced']['combine'] = array(
'#type' => 'checkbox',
'#title' => $this->t('Combine sort order with sort by'),
'#default_value' => $existing['sort']['advanced']['combine'],
'#description' => $this->t('Combines the sort by options and order (ascending or decending) into a single list. Use this to display "Option1 (ascending)", "Option1 (descending)", "Option2 (ascending)", "Option2 (descending)" in a single form element. Sort order should first be exposed by selecting <strong>Allow people to choose the sort order</strong>.'),
'#description' => $this->t('Combines the sort by options and order (ascending or decending) into a single list. Use this to display "Option1 (ascending)", "Option1 (descending)", "Option2 (ascending)", "Option2 (descending)" in a single form element. Sort order should first be exposed by selecting <em>Allow people to choose the sort order</em>.'),
'#states' => [
'enabled' => [
':input[name="exposed_form_options[expose_sort_order]"]' => ['checked' => TRUE],
],
],
);
$bef_options['sort']['advanced']['combine_rewrite'] = array(
'#type' => 'textarea',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment