Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown default is "none". Need a way to make it non-specified / all / any. #14

Closed
LucySparks opened this issue Oct 28, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@LucySparks
Copy link

We've set your Super Filter plugin up to use an "and" relationship between two category fields.

All our items have values for categories 1 and 2 set.

Our category 1 renders as a checkbox list, and category 2 as a dropdown.

"None" is the default value for the dropdowns, it lists the actual category values beneath "none".

The issue is: if you're looking for something specific in category 1, but you don't mind / set which value you want for category 2, the search will always return nothing, because the dropdown is specifically requesting a none or null value for category 2 but all out items have values for category 2.

Basically, we'd like to know how to change the default "none" value in the dropdown to an "all" value or an "any".

Screen Shot 2020-10-29 at 9 48 44 am

Cheers

@LucySparks LucySparks changed the title Dropdown cannot be non-specified / all / any Dropdown default is "none". Need a way to make it non-specified / all / any. Oct 28, 2020
@pdaleramirez
Copy link
Owner

@LucySparks It is possible to modify the text "None" by using the template override feature. Instruction here https://github.com/pdaleramirez/super-filter#using-super-filter. You need to input an override folder on search setup page. Then you can copy the example templates in the plugin pdaleramirez/superfilter/plain/fields/dopdown.html to your specified override folder. Then on your site templates you can modify the look of your html.

@LucySparks
Copy link
Author

Hi @pdaleramirez, thanks for your response.
I am already using an override folder structure that has duplicated and adapted the templates from the 'plain' variation in your plugin.
Yes, I can change the field label from none to all but I'm unclear on what value to pass or assign the dropdown option to return any or all options for category 2, in the filter query.
At a guess * didn't work.
Any light you could shed would be greatly appreciated.
Thanks

@pdaleramirez
Copy link
Owner

@LucySparks I see what you meant now, I will make an enhancement and make a release soon.

@pdaleramirez pdaleramirez self-assigned this Oct 30, 2020
@pdaleramirez pdaleramirez added the enhancement New feature or request label Oct 30, 2020
@pdaleramirez
Copy link
Owner

pdaleramirez commented Nov 1, 2020

@LucySparks I've released 1.2.1 a feature that allows you to change the category operator. On the Super filter settings choose "Or" under "Category Relationship Operator" field and save the setting. You can now use the "*" category value on your search parameter that value will return all elements that has category.

@LucySparks
Copy link
Author

Hi @pdaleramirez
Thanks for that, that's fixed it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants