Forums › Forums › Search & Filter Pro › Selectbox menu
- This topic has 14 replies, 2 voices, and was last updated 4 years, 7 months ago by Trevor.
-
Trevor(Private) April 14, 2020 at 4:25 pm #240009
I don’t see this CSS in there:
.sf-level-2 { display: none; } .sf-level-0 { display: none; }
Which should be:
.searchandfilter[data-sf-form-id="157762"] > ul > li.sf-field-taxonomy-destination .sf-level-2, .searchandfilter[data-sf-form-id="157762"] > ul > li.sf-field-taxonomy-destination .sf-level-0 { display: none; }
But, I understand why it does not sort now. You are keeping only level 1. But they are still sorted under level 0, then level 1.
Anonymous(Private) April 14, 2020 at 4:37 pm #240011Hello
I don’t know why don’t see my code, it was :.sf-field-taxonomy-destination .sf-level-2 { display: none; }
.sf-field-taxonomy-destination .sf-level-0 { display: none; }Now, I changed with your code :
.searchandfilter[data-sf-form-id=”157762″] > ul > li.sf-field-taxonomy-destination .sf-level-2,
.searchandfilter[data-sf-form-id=”157762″] > ul > li.sf-field-taxonomy-destination .sf-level-0 {
display: none;
}As i understand we can’t sort them directly by level 1?
Thank you
Trevor(Private) April 14, 2020 at 4:51 pm #240014It MIGHT be possible, but only with custom code (I don’t know what this would be though), using this filter:
https://searchandfilter.com/documentation/action-filter-reference/#filter-input-object
In code similar to this (in the child theme functions.php file):
function filter_input_destination($input_object, $sfid) { if(($input_object['name']!='_sft_destination')||($input_object['type']!='select')) { return $input_object; } if(!isset($input_object['options'])) { return $input_object; } // sort the array here, using PHP array_multisort() function. return $input_object; } add_filter('sf_input_object_pre', 'filter_input_destination', 10, 2);
And I would guess make sure it is the correct form ID.
-
AuthorPosts